summaryrefslogtreecommitdiff
path: root/driver_navcom.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-03-06 13:07:43 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-03-06 13:07:43 +0000
commitb00632ab81f8532200a69f79fbb9b369ae3302ad (patch)
treeaaf5556888672e3e30bb9b81b2811c68edad5cd4 /driver_navcom.c
parentfa63e809a527cbfb13ab8e0fe9a08543e508c261 (diff)
downloadgpsd-b00632ab81f8532200a69f79fbb9b369ae3302ad.tar.gz
Simplify the way ALLOW_RECONFIGURE works.
It now conditions out the speed-switcher, mode-switcher, and rate-switcher methods of the driver structure entirely. This makes it possible to condition out whole functions (rather than small bits that do device writes) almost everywhere. Build tested with ALLOW_RECONFIGURE off. This improvement should make the embedded people happy.
Diffstat (limited to 'driver_navcom.c')
-rw-r--r--driver_navcom.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/driver_navcom.c b/driver_navcom.c
index 808a37eb..41eea0d0 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -177,6 +177,7 @@ static void navcom_cmd_0x1c(struct gps_device_t *session, u_int8_t mode, u_int8_
mode, length);
}
+#ifdef ALLOW_RECONFIGURE
/* Serial Port Configuration */
static void navcom_cmd_0x11(struct gps_device_t *session, u_int8_t port_selection)
{
@@ -200,6 +201,7 @@ static void navcom_cmd_0x11(struct gps_device_t *session, u_int8_t port_selectio
gpsd_report(LOG_IO,
"Navcom: serial port selection: 0x%02x\n", port_selection);
}
+#endif /* ALLOW_RECONFIGURE */
static void navcom_probe_subtype(struct gps_device_t *session, unsigned int seq)
{
@@ -238,10 +240,10 @@ static void navcom_ping(struct gps_device_t *session)
/*@ +type @*/
}
+#ifdef ALLOW_RECONFIGURE
static bool navcom_speed(struct gps_device_t *session,
unsigned int speed, char parity, int stopbits)
{
-#ifdef ALLOW_RECONFIGURE
/* parity and stopbit switching aren't implemented */
if (parity!=(char)session->gpsdata.parity || stopbits!=(int)session->gpsdata.parity) {
return false;
@@ -303,10 +305,9 @@ static bool navcom_speed(struct gps_device_t *session,
different than the old one */
return true;
}
-#else
return false;
-#endif /* ALLOW_RECONFIGURE */
}
+#endif /* ALLOW_RECONFIGURE */
/* Ionosphere and UTC Data */
static gps_mask_t handle_0x83(struct gps_device_t *session)
@@ -1257,17 +1258,15 @@ const struct gps_type_t navcom_binary =
.probe_wakeup = navcom_ping, /* wakeup to be done before hunt */
.probe_detect = NULL, /* no probe */
.probe_subtype = navcom_probe_subtype, /* subtype probing */
-#ifdef ALLOW_RECONFIGURE
- .configurator = NULL, /* no reconfigure */
-#endif /* ALLOW_RECONFIGURE */
.get_packet = generic_get, /* use generic one */
.parse_packet = navcom_parse_input, /* parse message packets */
.rtcm_writer = pass_rtcm, /* send RTCM data straight */
+#ifdef ALLOW_RECONFIGURE
+ .configurator = NULL, /* no reconfigure */
.speed_switcher = navcom_speed, /* we do change baud rates */
.mode_switcher = NULL, /* there is not a mode switcher */
.rate_switcher = NULL, /* no sample-rate switcher */
.cycle_chars = -1, /* ignore, no rate switch */
-#ifdef ALLOW_RECONFIGURE
.revert = NULL, /* no reversion code */
#endif /* ALLOW_RECONFIGURE */
.wrapup = NULL, /* ignore, no wrapup */