From 423cbc2c6d979e0d5b130fabea7553d24623ab2f Mon Sep 17 00:00:00 2001 From: Jm Casler Date: Tue, 29 Sep 2020 00:59:26 -0700 Subject: [PATCH] Added frequency information to debug output (#447) and cleanup of screen.cpp and meshwifi.cpp --- src/graphics/Screen.cpp | 22 ++++++++++------------ src/mesh/RadioInterface.cpp | 5 +++++ src/meshwifi/meshwifi.cpp | 4 ++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index beec7082..2ea03c63 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -241,18 +241,17 @@ static void drawGPS(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus } } -//asdf static void drawGPSAltitude(OLEDDisplay *display, int16_t x, int16_t y, const GPSStatus *gps) { String displayLine = ""; if (!gps->getIsConnected()) { - //displayLine = "No GPS Module"; - //display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); + // displayLine = "No GPS Module"; + // display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); } else if (!gps->getHasLock()) { - //displayLine = "No GPS Lock"; - //display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); + // displayLine = "No GPS Lock"; + // display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); } else { - + displayLine = "Altitude: " + String(gps->getAltitude()) + "m"; display->drawString(x + (SCREEN_WIDTH - (display->getStringWidth(displayLine))) / 2, y, displayLine); } @@ -905,8 +904,8 @@ void DebugInfo::drawFrameWiFi(OLEDDisplay *display, OLEDDisplayUiState *state, i display->drawString(x, y + FONT_HEIGHT * 1, "Connection Lost"); } else if (WiFi.status() == WL_CONNECT_FAILED) { display->drawString(x, y + FONT_HEIGHT * 1, "Connection Failed"); - //} else if (WiFi.status() == WL_DISCONNECTED) { - // display->drawString(x, y + FONT_HEIGHT * 1, "Disconnected"); + //} else if (WiFi.status() == WL_DISCONNECTED) { + // display->drawString(x, y + FONT_HEIGHT * 1, "Disconnected"); } else if (WiFi.status() == WL_IDLE_STATUS) { display->drawString(x, y + FONT_HEIGHT * 1, "Idle ... Reconnecting"); } else { @@ -1009,10 +1008,8 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat display->drawString(x, y, String("USB")); } - display->drawString(x + SCREEN_WIDTH - display->getStringWidth("Mode " + String(channelSettings.modem_config)), - y, "Mode " + String(channelSettings.modem_config)); - - + display->drawString(x + SCREEN_WIDTH - display->getStringWidth("Mode " + String(channelSettings.modem_config)), y, + "Mode " + String(channelSettings.modem_config)); // Line 2 uint32_t currentMillis = millis(); @@ -1029,6 +1026,7 @@ void DebugInfo::drawFrameSettings(OLEDDisplay *display, OLEDDisplayUiState *stat String(days) + "d " + (hours < 10 ? "0" : "") + String(hours) + ":" + (minutes < 10 ? "0" : "") + String(minutes) + ":" + (seconds < 10 ? "0" : "") + String(seconds)); + // Line 3 drawGPSAltitude(display, x, y + FONT_HEIGHT * 2, gpsStatus); // Line 4 diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 1fcee0dc..4ab07103 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -162,6 +162,11 @@ void RadioInterface::applyModemConfig() DEBUG_MSG("Set radio: name=%s, config=%u, ch=%d, power=%d\n", channelSettings.name, channelSettings.modem_config, channel_num, power); + DEBUG_MSG("Radio myRegion->freq: %f\n", myRegion->freq); + DEBUG_MSG("Radio myRegion->spacing: %f\n", myRegion->spacing); + DEBUG_MSG("Radio myRegion->numChannels: %d\n", myRegion->numChannels); + DEBUG_MSG("Radio channel_num: %d\n", channel_num); + DEBUG_MSG("Radio frequency: %f\n", freq); } /** diff --git a/src/meshwifi/meshwifi.cpp b/src/meshwifi/meshwifi.cpp index b03ccede..b7a8dace 100644 --- a/src/meshwifi/meshwifi.cpp +++ b/src/meshwifi/meshwifi.cpp @@ -25,8 +25,8 @@ bool isWifiAvailable() const char *wifiName = radioConfig.preferences.wifi_ssid; const char *wifiPsw = radioConfig.preferences.wifi_password; - //strcpy(radioConfig.preferences.wifi_ssid, ""); - //strcpy(radioConfig.preferences.wifi_password, ""); + // strcpy(radioConfig.preferences.wifi_ssid, ""); + // strcpy(radioConfig.preferences.wifi_password, ""); if (*wifiName && *wifiPsw) {