From 5b67d1cf33308baef2e3bcf3294b9c7179d800b3 Mon Sep 17 00:00:00 2001 From: Paulius Zaleckas Date: Sun, 28 Mar 2010 18:02:16 +0300 Subject: Fix building with --disable-reconfigure Signed-off-by: Eric S. Raymond --- driver_evermore.c | 59 +++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) (limited to 'driver_evermore.c') diff --git a/driver_evermore.c b/driver_evermore.c index 5aeba9ea..440cf219 100644 --- a/driver_evermore.c +++ b/driver_evermore.c @@ -409,36 +409,6 @@ static ssize_t evermore_control_send(struct gps_device_t *session, char *buf, si /*@ -charint +usedef +compdef @*/ #endif /* ALLOW_CONTROLSEND */ -#ifdef ALLOW_RECONFIGURE -static bool evermore_speed(struct gps_device_t *session, - speed_t speed, char parity, int stopbits) -{ - /*@ -type @*/ - gpsd_report(LOG_PROG, "evermore_speed(%u%c%d)\n", speed, parity, stopbits); - /* parity and stopbit switching aren't available on this chip */ - if (parity!=session->gpsdata.dev.parity || stopbits!=(int)session->gpsdata.dev.parity) { - return false; - } else { - unsigned char tmp8; - char msg[] = { - 0x89, /* 0: msg ID, Serial Port Configuration */ - 0x01, /* 1: bit 0 cfg for main serial, bit 1 cfg for DGPS port */ - 0x00, /* 2: baud rate for main serial; 4800(0), 9600(1), 19200(2), 38400(3) */ - 0x00, /* 3: baud rate for DGPS serial port; 4800(0), 9600(1), etc */ - }; - switch (speed) { - case 4800: tmp8 = 0; break; - case 9600: tmp8 = 1; break; - case 19200: tmp8 = 2; break; - case 38400: tmp8 = 3; break; - default: return false; - } - msg[2] = tmp8; - return (evermore_control_send(session, msg, sizeof(msg)) != -1); - } - /*@ +type @*/ -} - static bool evermore_protocol(struct gps_device_t *session, int protocol) { /*@ +charint */ @@ -518,6 +488,35 @@ static void evermore_event_hook(struct gps_device_t *session, event_t event) } } +#ifdef ALLOW_RECONFIGURE +static bool evermore_speed(struct gps_device_t *session, + speed_t speed, char parity, int stopbits) +{ + /*@ -type @*/ + gpsd_report(LOG_PROG, "evermore_speed(%u%c%d)\n", speed, parity, stopbits); + /* parity and stopbit switching aren't available on this chip */ + if (parity!=session->gpsdata.dev.parity || stopbits!=(int)session->gpsdata.dev.parity) { + return false; + } else { + unsigned char tmp8; + char msg[] = { + 0x89, /* 0: msg ID, Serial Port Configuration */ + 0x01, /* 1: bit 0 cfg for main serial, bit 1 cfg for DGPS port */ + 0x00, /* 2: baud rate for main serial; 4800(0), 9600(1), 19200(2), 38400(3) */ + 0x00, /* 3: baud rate for DGPS serial port; 4800(0), 9600(1), etc */ + }; + switch (speed) { + case 4800: tmp8 = 0; break; + case 9600: tmp8 = 1; break; + case 19200: tmp8 = 2; break; + case 38400: tmp8 = 3; break; + default: return false; + } + msg[2] = tmp8; + return (evermore_control_send(session, msg, sizeof(msg)) != -1); + } + /*@ +type @*/ +} static bool evermore_rate_switcher(struct gps_device_t *session, double rate) /* change the sample rate of the GPS */ -- cgit v1.2.1