diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-07-29 15:14:59 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-07-29 15:14:59 +0000 |
commit | c61bb153749934fefd171003f25835f6e34e07a0 (patch) | |
tree | 3b61f09e86a3656a68371654c04e750755654fce | |
parent | 4e33cd50fb5b26c579b4654f1eebd8e8874e0047 (diff) | |
download | gpsd-c61bb153749934fefd171003f25835f6e34e07a0.tar.gz |
The retry change was not smart.
-rw-r--r-- | sirfmon.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -664,7 +664,7 @@ static unsigned int *ip, rates[] = {0, 4800, 9600, 19200, 38400, 57600}; static unsigned int hunt_open(unsigned int *pstopbits) { unsigned int trystopbits; - int st, retries; + int st; /* * Tip from Chris Kuethe: the FTDI chip used in the Trip-Nav * 200 (and possibly other USB GPSes) gets completely hosed @@ -677,16 +677,15 @@ static unsigned int hunt_open(unsigned int *pstopbits) for (trystopbits = 1; trystopbits <= 2; trystopbits++) { *pstopbits = trystopbits; - for (ip = rates; ip < rates + sizeof(rates)/sizeof(rates[0]); ip++) - for (retries = 10; retries; retries--) { - if ((st = set_speed(*ip, trystopbits)) == SIRF_PACKET) - return get_speed(&ttyset); - else if (st == NMEA_PACKET) { - (void)fprintf(stderr, "Switching to SiRF mode...\n"); - (void)nmea_send(controlfd,"$PSRF100,0,%d,8,1,0", *ip); - (void)usleep(10000); - } + for (ip = rates; ip < rates + sizeof(rates)/sizeof(rates[0]); ip++) { + if ((st = set_speed(*ip, trystopbits)) == SIRF_PACKET) + return get_speed(&ttyset); + else if (st == NMEA_PACKET) { + (void)fprintf(stderr, "Switching to SiRF mode...\n"); + (void)nmea_send(controlfd,"$PSRF100,0,%d,8,1,0", *ip); + return *ip; } + } } return 0; } |