Skip to content

Commit

Permalink
Empty method for non-TFT LCD
Browse files Browse the repository at this point in the history
  • Loading branch information
kimble4 committed Oct 8, 2024
1 parent bde446a commit 4054d7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
5 changes: 5 additions & 0 deletions src/lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,11 @@ void LcdTask::onButton(int long_press)
}
}

void LcdTask::setWifiMode(bool client, bool connected)
{
//only used by the TFT display
}

LcdTask lcd;

#endif // ENABLE_SCREEN_LCD_TFT
3 changes: 3 additions & 0 deletions src/lcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class LcdTask : public MicroTasks::Task
void setInfoLine(LcdInfoLine info);

void onButton(int event);


LcdInfoLine getNextInfoLine(LcdInfoLine info);

Expand All @@ -154,6 +155,8 @@ class LcdTask : public MicroTasks::Task
void display(const __FlashStringHelper *msg, int x, int y, int time, uint32_t flags);
void display(String &msg, int x, int y, int time, uint32_t flags);
void display(const char *msg, int x, int y, int time, uint32_t flags);

void setWifiMode(bool client, bool connected);
};

#endif // ENABLE_SCREEN_LCD_TFT
Expand Down
10 changes: 0 additions & 10 deletions src/net_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ void NetManagerTask::wifiStartAccessPoint()
_lcd.display(String(F("Pass: ")) + _softAP_password, 0, 1, 15 * 1000, LCD_CLEAR_LINE);

_led.setWifiMode(false, false);
#ifdef ENABLE_SCREEN_LCD_TFT
_lcd.setWifiMode(false, false);
#endif //ENABLE_SCREEN_LCD_TFT
_apClients = 0;
_state = NetState::AccessPointConnecting;
}
Expand All @@ -157,9 +155,7 @@ void NetManagerTask::wifiStartClient()
wifiClientConnect();

_led.setWifiMode(true, false);
#ifdef ENABLE_SCREEN_LCD_TFT
_lcd.setWifiMode(true, false);
#endif //ENABLE_SCREEN_LCD_TFT
_state = NetState::StationClientConnecting;
}

Expand Down Expand Up @@ -211,9 +207,7 @@ void NetManagerTask::haveNetworkConnection(IPAddress myAddress)
Mongoose.ipConfigChanged();

_led.setWifiMode(true, true);
#ifdef ENABLE_SCREEN_LCD_TFT
_lcd.setWifiMode(true, true);
#endif //ENABLE_SCREEN_LCD_TFT
_time.setHost(sntp_hostname.c_str());

_apAutoApStopTime = millis() + ACCESS_POINT_AUTO_STOP_TIMEOUT;
Expand Down Expand Up @@ -290,9 +284,7 @@ void NetManagerTask::wifiOnAPModeStationConnected(const WiFiEventSoftAPModeStati
_lcd.display(_ipaddress, 0, 1, (0 == _apClients ? 15 : 5) * 1000, LCD_CLEAR_LINE);

_led.setWifiMode(false, true);
#ifdef ENABLE_SCREEN_LCD_TFT
_lcd.setWifiMode(false, true);
#endif //ENABLE_SCREEN_LCD_TFT
_apClients++;
}

Expand All @@ -302,9 +294,7 @@ void NetManagerTask::wifiOnAPModeStationDisconnected(const WiFiEventSoftAPModeSt

if(0 == _apClients && NetState::AccessPointConnecting == _state) {
_led.setWifiMode(false, false);
#ifdef ENABLE_SCREEN_LCD_TFT
_lcd.setWifiMode(false, false);
#endif //ENABLE_SCREEN_LCD_TFT
}
}

Expand Down

0 comments on commit 4054d7f

Please sign in to comment.