summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-29 15:14:59 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-29 15:14:59 +0000
commitc61bb153749934fefd171003f25835f6e34e07a0 (patch)
tree3b61f09e86a3656a68371654c04e750755654fce
parent4e33cd50fb5b26c579b4654f1eebd8e8874e0047 (diff)
downloadgpsd-c61bb153749934fefd171003f25835f6e34e07a0.tar.gz
The retry change was not smart.
-rw-r--r--sirfmon.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sirfmon.c b/sirfmon.c
index 12bdc364..d2e789fc 100644
--- a/sirfmon.c
+++ b/sirfmon.c
@@ -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;
}