forked from xiaozhi/xiaozhi-esp32
graceful code
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
#include "audio_codecs/cores3_audio_codec.h"
|
||||
#include "display/lcd_display.h"
|
||||
#include "application.h"
|
||||
#include "button.h"
|
||||
#include "config.h"
|
||||
#include "i2c_device.h"
|
||||
#include "iot/thing_manager.h"
|
||||
@@ -120,7 +119,6 @@ private:
|
||||
Aw9523* aw9523_;
|
||||
Ft6336* ft6336_;
|
||||
LcdDisplay* display_;
|
||||
Button boot_button_;
|
||||
esp_timer_handle_t touchpad_timer_;
|
||||
|
||||
void InitializeI2c() {
|
||||
@@ -273,16 +271,6 @@ private:
|
||||
});
|
||||
}
|
||||
|
||||
void InitializeButtons() {
|
||||
boot_button_.OnClick([this]() {
|
||||
auto& app = Application::GetInstance();
|
||||
if (app.GetDeviceState() == kDeviceStateStarting && !WifiStation::GetInstance().IsConnected()) {
|
||||
ResetWifiConfiguration();
|
||||
}
|
||||
app.ToggleChatState();
|
||||
});
|
||||
}
|
||||
|
||||
// 物联网初始化,添加对 AI 可见设备
|
||||
void InitializeIot() {
|
||||
auto& thing_manager = iot::ThingManager::GetInstance();
|
||||
@@ -290,14 +278,13 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
M5StackCoreS3Board() : boot_button_(GPIO_NUM_1) {
|
||||
M5StackCoreS3Board() {
|
||||
InitializeI2c();
|
||||
InitializeAxp2101();
|
||||
InitializeAw9523();
|
||||
I2cDetect();
|
||||
InitializeSpi();
|
||||
InitializeIli9342Display();
|
||||
InitializeButtons();
|
||||
InitializeIot();
|
||||
InitializeFt6336TouchPad();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user