File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 47
47
.ccls-cache
48
48
compile_commands.json
49
49
.aider *
50
+ .clang-format
Original file line number Diff line number Diff line change 6
6
config EXAMPLES_GPS
7
7
tristate "GPS example"
8
8
default n
9
- select GPSUTILS_MINMEA_LIB
9
+ depends on GNSSUTILS_MINMEA_LIB
10
10
---help---
11
11
Enable the gps test example
12
12
Original file line number Diff line number Diff line change @@ -54,13 +54,22 @@ int main(int argc, FAR char *argv[])
54
54
int cnt ;
55
55
char ch ;
56
56
char line [MINMEA_MAX_LENGTH ];
57
+ char * port = "/dev/ttyS1" ;
58
+
59
+ /* Get the GPS serial port argument. If none specified, default to ttyS1 */
60
+
61
+ if (argc > 1 )
62
+ {
63
+ port = argv [1 ];
64
+ }
57
65
58
66
/* Open the GPS serial port */
59
67
60
- fd = open ("/dev/ttyS1" , O_RDONLY );
68
+ fd = open (port , O_RDONLY );
61
69
if (fd < 0 )
62
70
{
63
- printf ("Unable to open file /dev/ttyS1\n" );
71
+ fprintf (stderr , "Unable to open file %s\n" , port );
72
+ return 1 ;
64
73
}
65
74
66
75
/* Run forever */
You can’t perform that action at this time.
0 commit comments