Skip to content

Commit

Permalink
Fix mini and v6 status bar channel refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
justcallmekoko committed Feb 25, 2024
1 parent 2cf3970 commit 4188819
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 14 additions & 3 deletions esp32_marauder/MenuFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,8 @@ void MenuFunctions::battery2(bool initial)
void MenuFunctions::updateStatusBar()
{
display_obj.tft.setTextSize(1);

bool status_changed = false;

#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER)
display_obj.tft.setFreeFont(NULL);
Expand All @@ -937,6 +939,7 @@ void MenuFunctions::updateStatusBar()
if (this->old_gps_sat_count != gps_obj.getNumSats()) {
this->old_gps_sat_count = gps_obj.getNumSats();
display_obj.tft.fillRect(0, 0, 240, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
status_changed = true;
}

// GPS Stuff
Expand Down Expand Up @@ -968,9 +971,13 @@ void MenuFunctions::updateStatusBar()
display_obj.tft.setTextColor(TFT_WHITE, STATUSBAR_COLOR);

// WiFi Channel Stuff
if (wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) {
if ((wifi_scan_obj.set_channel != wifi_scan_obj.old_channel) || (status_changed)) {
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER)
display_obj.tft.fillRect(43, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#else
display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#endif
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
Expand Down Expand Up @@ -1077,7 +1084,11 @@ void MenuFunctions::drawStatusBar()

// WiFi Channel Stuff
wifi_scan_obj.old_channel = wifi_scan_obj.set_channel;
display_obj.tft.fillRect(50, 0, 50, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#if defined(MARAUDER_MINI) || defined(MARAUDER_M5STICKC) || defined(MARAUDER_REV_FEATHER)
display_obj.tft.fillRect(43, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#else
display_obj.tft.fillRect(50, 0, TFT_WIDTH * 0.21, STATUS_BAR_WIDTH, STATUSBAR_COLOR);
#endif
#ifdef HAS_ILI9341
display_obj.tft.drawString("CH: " + (String)wifi_scan_obj.set_channel, 50, 0, 2);
#endif
Expand Down
4 changes: 2 additions & 2 deletions esp32_marauder/configs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

//// BOARD TARGETS
//#define MARAUDER_M5STICKC
//#define MARAUDER_MINI
#define MARAUDER_MINI
//#define MARAUDER_V4
#define MARAUDER_V6
//#define MARAUDER_V6
//#define MARAUDER_V6_1
//#define MARAUDER_KIT
//#define GENERIC_ESP32
Expand Down

0 comments on commit 4188819

Please sign in to comment.