drivers/ublox: Clean up some debug mode code
authorKeith Packard <keithp@keithp.com>
Thu, 10 Nov 2022 00:28:21 +0000 (16:28 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 10 Nov 2022 00:28:21 +0000 (16:28 -0800)
Not used in production, so we didn't catch a couple of type errors.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_gps_ublox.c

index 57cbf22a77b50245975955925096ba85ac9723f5..607e9ea9402fcc4bd5f6da92246edbe76bce8fa2 100644 (file)
@@ -63,12 +63,13 @@ static uint16_t ao_ublox_len;
 
 #if AO_UBLOX_DEBUG
 
-static uint8_t ao_gps_dbg_enable;
 
 #define DBG_PROTO      1
 #define DBG_CHAR       2
 #define DBG_INIT       4
 
+static uint8_t ao_gps_dbg_enable = DBG_PROTO|DBG_CHAR|DBG_INIT;
+
 static void ao_gps_dbg(int level, char *format, ...) {
        va_list a;
 
@@ -788,7 +789,7 @@ ao_gps(void)
 #if AO_UBLOX_DEBUG
 static void ao_gps_option(void)
 {
-       uint16_t r = ao_cmd_hex();
+       uint8_t r = (uint8_t) ao_cmd_hex();
        if (ao_cmd_status != ao_cmd_success) {
                ao_cmd_status = ao_cmd_success;
                ao_gps_show();