mirror of
https://github.com/78/xiaozhi-esp32.git
synced 2026-02-11 06:33:48 +00:00
Update esp-ml307 component version to 3.6.2 to support UART DMA (#1724)
* Update esp-ml307 dependency version to ~3.6.0 in idf_component.yml * Update .gitignore to include 'dist/' directory, add ml307 and dual_network_board source files to CMakeLists.txt, and update esp-ml307 dependency version to ~3.6.2 in idf_component.yml. Refactor CompactWifiBoard and CompactWifiBoardLCD classes to inherit from WifiBoard instead of DualNetworkBoard, simplifying network handling logic.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,6 +2,7 @@ tmp/
|
|||||||
components/
|
components/
|
||||||
managed_components/
|
managed_components/
|
||||||
build/
|
build/
|
||||||
|
dist/
|
||||||
.vscode/
|
.vscode/
|
||||||
.devcontainer/
|
.devcontainer/
|
||||||
sdkconfig.old
|
sdkconfig.old
|
||||||
|
|||||||
@@ -779,6 +779,8 @@ if(CONFIG_IDF_TARGET_ESP32)
|
|||||||
"display/lvgl_display/jpg/image_to_jpeg.cpp"
|
"display/lvgl_display/jpg/image_to_jpeg.cpp"
|
||||||
"display/lvgl_display/jpg/jpeg_to_image.c"
|
"display/lvgl_display/jpg/jpeg_to_image.c"
|
||||||
"boards/common/nt26_board.cc"
|
"boards/common/nt26_board.cc"
|
||||||
|
"boards/common/ml307_board.cc"
|
||||||
|
"boards/common/dual_network_board.cc"
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "dual_network_board.h"
|
#include "wifi_board.h"
|
||||||
#include "codecs/no_audio_codec.h"
|
#include "codecs/no_audio_codec.h"
|
||||||
#include "display/lcd_display.h"
|
#include "display/lcd_display.h"
|
||||||
#include "system_reset.h"
|
#include "system_reset.h"
|
||||||
@@ -57,7 +57,7 @@ static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = {
|
|||||||
|
|
||||||
#define TAG "ESP32-LCD-MarsbearSupport"
|
#define TAG "ESP32-LCD-MarsbearSupport"
|
||||||
|
|
||||||
class CompactWifiBoardLCD : public DualNetworkBoard {
|
class CompactWifiBoardLCD : public WifiBoard {
|
||||||
private:
|
private:
|
||||||
Button boot_button_;
|
Button boot_button_;
|
||||||
Button touch_button_;
|
Button touch_button_;
|
||||||
@@ -136,26 +136,14 @@ private:
|
|||||||
|
|
||||||
boot_button_.OnClick([this]() {
|
boot_button_.OnClick([this]() {
|
||||||
auto& app = Application::GetInstance();
|
auto& app = Application::GetInstance();
|
||||||
if (GetNetworkType() == NetworkType::WIFI) {
|
if (app.GetDeviceState() == kDeviceStateStarting) {
|
||||||
if (app.GetDeviceState() == kDeviceStateStarting) {
|
EnterWifiConfigMode();
|
||||||
// cast to WifiBoard
|
return;
|
||||||
auto& wifi_board = static_cast<WifiBoard&>(GetCurrentBoard());
|
|
||||||
wifi_board.EnterWifiConfigMode();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gpio_set_level(BUILTIN_LED_GPIO, 1);
|
gpio_set_level(BUILTIN_LED_GPIO, 1);
|
||||||
app.ToggleChatState();
|
app.ToggleChatState();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
boot_button_.OnDoubleClick([this]() {
|
|
||||||
auto& app = Application::GetInstance();
|
|
||||||
if (app.GetDeviceState() == kDeviceStateStarting || app.GetDeviceState() == kDeviceStateWifiConfiguring) {
|
|
||||||
SwitchNetworkType();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
asr_button_.OnClick([this]() {
|
asr_button_.OnClick([this]() {
|
||||||
std::string wake_word="你好小智";
|
std::string wake_word="你好小智";
|
||||||
Application::GetInstance().WakeWordInvoke(wake_word);
|
Application::GetInstance().WakeWordInvoke(wake_word);
|
||||||
@@ -174,8 +162,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CompactWifiBoardLCD() :
|
CompactWifiBoardLCD() : WifiBoard(),
|
||||||
DualNetworkBoard(ML307_TX_PIN, ML307_RX_PIN),
|
|
||||||
boot_button_(BOOT_BUTTON_GPIO), touch_button_(TOUCH_BUTTON_GPIO), asr_button_(ASR_BUTTON_GPIO) {
|
boot_button_(BOOT_BUTTON_GPIO), touch_button_(TOUCH_BUTTON_GPIO), asr_button_(ASR_BUTTON_GPIO) {
|
||||||
InitializeSpi();
|
InitializeSpi();
|
||||||
InitializeLcdDisplay();
|
InitializeLcdDisplay();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "dual_network_board.h"
|
#include "wifi_board.h"
|
||||||
#include "codecs/no_audio_codec.h"
|
#include "codecs/no_audio_codec.h"
|
||||||
#include "system_reset.h"
|
#include "system_reset.h"
|
||||||
#include "application.h"
|
#include "application.h"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#define TAG "ESP32-MarsbearSupport"
|
#define TAG "ESP32-MarsbearSupport"
|
||||||
|
|
||||||
class CompactWifiBoard : public DualNetworkBoard {
|
class CompactWifiBoard : public WifiBoard {
|
||||||
private:
|
private:
|
||||||
Button boot_button_;
|
Button boot_button_;
|
||||||
Button touch_button_;
|
Button touch_button_;
|
||||||
@@ -104,26 +104,14 @@ private:
|
|||||||
|
|
||||||
boot_button_.OnClick([this]() {
|
boot_button_.OnClick([this]() {
|
||||||
auto& app = Application::GetInstance();
|
auto& app = Application::GetInstance();
|
||||||
if (GetNetworkType() == NetworkType::WIFI) {
|
if (app.GetDeviceState() == kDeviceStateStarting) {
|
||||||
if (app.GetDeviceState() == kDeviceStateStarting) {
|
EnterWifiConfigMode();
|
||||||
// cast to WifiBoard
|
return;
|
||||||
auto& wifi_board = static_cast<WifiBoard&>(GetCurrentBoard());
|
|
||||||
wifi_board.EnterWifiConfigMode();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gpio_set_level(BUILTIN_LED_GPIO, 1);
|
gpio_set_level(BUILTIN_LED_GPIO, 1);
|
||||||
app.ToggleChatState();
|
app.ToggleChatState();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
boot_button_.OnDoubleClick([this]() {
|
|
||||||
auto& app = Application::GetInstance();
|
|
||||||
if (app.GetDeviceState() == kDeviceStateStarting || app.GetDeviceState() == kDeviceStateWifiConfiguring) {
|
|
||||||
SwitchNetworkType();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
asr_button_.OnClick([this]() {
|
asr_button_.OnClick([this]() {
|
||||||
std::string wake_word="你好小智";
|
std::string wake_word="你好小智";
|
||||||
Application::GetInstance().WakeWordInvoke(wake_word);
|
Application::GetInstance().WakeWordInvoke(wake_word);
|
||||||
@@ -145,7 +133,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CompactWifiBoard() : DualNetworkBoard(ML307_TX_PIN, ML307_RX_PIN), boot_button_(BOOT_BUTTON_GPIO), touch_button_(TOUCH_BUTTON_GPIO), asr_button_(ASR_BUTTON_GPIO)
|
CompactWifiBoard() : WifiBoard(), boot_button_(BOOT_BUTTON_GPIO), touch_button_(TOUCH_BUTTON_GPIO), asr_button_(ASR_BUTTON_GPIO)
|
||||||
{
|
{
|
||||||
InitializeDisplayI2c();
|
InitializeDisplayI2c();
|
||||||
InitializeSsd1306Display();
|
InitializeSsd1306Display();
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ dependencies:
|
|||||||
78/esp-wifi-connect: ~3.0.2
|
78/esp-wifi-connect: ~3.0.2
|
||||||
espressif/esp_audio_effects: ~1.2.1
|
espressif/esp_audio_effects: ~1.2.1
|
||||||
espressif/esp_audio_codec: ~2.4.1
|
espressif/esp_audio_codec: ~2.4.1
|
||||||
78/esp-ml307: ~3.5.3
|
78/esp-ml307: ~3.6.2
|
||||||
78/uart-eth-modem:
|
78/uart-eth-modem:
|
||||||
version: ~0.2.1
|
version: ~0.3.0
|
||||||
rules:
|
rules:
|
||||||
- if: target not in [esp32]
|
- if: target not in [esp32]
|
||||||
78/xiaozhi-fonts: ~1.6.0
|
78/xiaozhi-fonts: ~1.6.0
|
||||||
|
|||||||
Reference in New Issue
Block a user