summaryrefslogtreecommitdiff
path: root/driver_evermore.c
diff options
context:
space:
mode:
authorPaulius Zaleckas <paulius.zaleckas@gmail.com>2010-03-28 18:02:16 +0300
committerEric S. Raymond <esr@thyrsus.com>2010-03-28 20:33:04 -0400
commit5b67d1cf33308baef2e3bcf3294b9c7179d800b3 (patch)
tree304ebd7a81e841d8af726362d109682244549100 /driver_evermore.c
parent81634abdf4c3ed17d683cd422979ef28f4b12603 (diff)
downloadgpsd-5b67d1cf33308baef2e3bcf3294b9c7179d800b3.tar.gz
Fix building with --disable-reconfigure
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'driver_evermore.c')
-rw-r--r--driver_evermore.c59
1 files changed, 29 insertions, 30 deletions
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 */