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 4747.ccls-cache
4848compile_commands.json
4949.aider *
50+ .clang-format
Original file line number Diff line number Diff line change 66config EXAMPLES_GPS
77 tristate "GPS example"
88 default n
9- select GPSUTILS_MINMEA_LIB
9+ depends on GNSSUTILS_MINMEA_LIB
1010 ---help---
1111 Enable the gps test example
1212
Original file line number Diff line number Diff line change @@ -54,13 +54,22 @@ int main(int argc, FAR char *argv[])
5454 int cnt ;
5555 char ch ;
5656 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+ }
5765
5866 /* Open the GPS serial port */
5967
60- fd = open ("/dev/ttyS1" , O_RDONLY );
68+ fd = open (port , O_RDONLY );
6169 if (fd < 0 )
6270 {
63- printf ("Unable to open file /dev/ttyS1\n" );
71+ fprintf (stderr , "Unable to open file %s\n" , port );
72+ return 1 ;
6473 }
6574
6675 /* Run forever */
You can’t perform that action at this time.
0 commit comments