From 88f40e5d35e53ec53950ff2cb986b657e415ba42 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sun, 13 Oct 2019 17:22:30 +0200 Subject: [PATCH] code sanitizations (compiler warnings) --- src/lorawan.cpp | 5 ++++- src/timesync.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lorawan.cpp b/src/lorawan.cpp index efa09187..398e86f4 100644 --- a/src/lorawan.cpp +++ b/src/lorawan.cpp @@ -450,7 +450,7 @@ void myEventCallback(void *pUserData, ev_t ev) { snprintf(lmic_event_msg, LMIC_EVENTMSG_LEN, "%-16s", evNames[ev] + 3); // +3 to strip "EV_" else - snprintf(lmic_event_msg, LMIC_EVENTMSG_LEN, "LMIC event %-04u ", ev); + snprintf(lmic_event_msg, LMIC_EVENTMSG_LEN, "LMIC event %-4u ", ev); // process current event message switch (ev) { @@ -468,6 +468,9 @@ void myEventCallback(void *pUserData, ev_t ev) { // replace descriptor from library with more descriptive term snprintf(lmic_event_msg, LMIC_EVENTMSG_LEN, "%-16s", "JOIN_WAIT"); break; + + default: + break; } // add Lora send queue length to display diff --git a/src/timesync.cpp b/src/timesync.cpp index 917140d0..f2f8d14a 100644 --- a/src/timesync.cpp +++ b/src/timesync.cpp @@ -194,7 +194,7 @@ int recv_timesync_ans(const uint8_t buf[], const uint8_t buf_len) { uint32_t timestamp_sec, *timestamp_ptr; // extract 1 byte timezone from buffer (one step being 15min * 60s = 900s) - uint32_t timezone_sec = buf[0] * 900; + // uint32_t timezone_sec = buf[0] * 900; // for future use buf++; // extract 4 bytes timestamp from buffer