summaryrefslogtreecommitdiff
path: root/drivers.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-29 11:01:41 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-03-29 11:01:41 -0400
commit173c43dbc016bc44bc62a852526a87b78817d636 (patch)
treeafddc6678b5ab6f75b8f44cefeaaa163ad9972f1 /drivers.c
parent7e753e02514e46ae59f4e532c854b764b876ce0a (diff)
downloadgpsd-173c43dbc016bc44bc62a852526a87b78817d636.tar.gz
Squeeze more code out of the minimal build.
Diffstat (limited to 'drivers.c')
-rw-r--r--drivers.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers.c b/drivers.c
index 864aa65f..12383722 100644
--- a/drivers.c
+++ b/drivers.c
@@ -246,10 +246,9 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
}
}
-#ifdef ALLOW_RECONFIGURE
+#if defined(ALLOW_RECONFIGURE) && defined(BINARY_ENABLE)
static void nmea_mode_switch(struct gps_device_t *session, int mode)
{
-#ifdef BINARY_ENABLE
/*
* If the daemon has seen this device in a binary mode, we may
* actually know how to switch back.
@@ -268,9 +267,8 @@ static void nmea_mode_switch(struct gps_device_t *session, int mode)
}
/*@+shiftnegative@*/
}
-#endif /* BINARY_ENABLE */
}
-#endif /* ALLOW_RECONFIGURE */
+#endif /* defined(ALLOW_RECONFIGURE) && defined(BINARY_ENABLE) */
/* *INDENT-OFF* */
const struct gps_type_t nmea = {
@@ -286,7 +284,11 @@ const struct gps_type_t nmea = {
.event_hook = nmea_event_hook, /* lifetime event handler */
#ifdef ALLOW_RECONFIGURE
.speed_switcher = NULL, /* no speed switcher */
+#ifdef BINARY_ENABLE
.mode_switcher = nmea_mode_switch, /* maybe switchable if it was a SiRF */
+#else
+ .mode_switcher = NULL, /* no binary mode to revert to */
+#endif /* BINARY_ENABLE */
.rate_switcher = NULL, /* no sample-rate switcher */
.min_cycle = 1, /* not relevant, no rate switch */
#endif /* ALLOW_RECONFIGURE */