连接wifi时按下boot重置wifi

This commit is contained in:
Terrence
2024-11-25 02:27:21 +08:00
parent 472219d5bf
commit b07ec1a148
10 changed files with 49 additions and 6 deletions

View File

@@ -11,6 +11,7 @@
#include <esp_lcd_panel_vendor.h>
#include <driver/i2c_master.h>
#include <driver/spi_common.h>
#include <wifi_station.h>
#define TAG "LichuangDevBoard"
@@ -71,7 +72,11 @@ private:
void InitializeButtons() {
boot_button_.OnClick([this]() {
Application::GetInstance().ToggleChatState();
auto& app = Application::GetInstance();
if (app.GetChatState() == kChatStateUnknown && !WifiStation::GetInstance().IsConnected()) {
ResetWifiConfiguration();
}
app.ToggleChatState();
});
}