Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
420 changes: 401 additions & 19 deletions main/CMakeLists.txt

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ config DEFAULT_ASSETS_URL_PREFIX
help
The assets will be downloaded from this URL.

config FLASH_DEFAULT_ASSETS
bool "Flash Default Assets"
default y
help
Download and flash default assets to the assets partition during build.
If disabled, the assets partition will not be automatically populated.

choice
prompt "Default Language"
default LANGUAGE_ZH_CN
Expand Down
13 changes: 1 addition & 12 deletions main/boards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,6 @@ mkdir main/boards/my-custom-board

#define TAG "MyCustomBoard"

// 声明字体
LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);

class MyCustomBoard : public WifiBoard {
private:
i2c_master_bus_handle_t codec_i2c_bus_;
Expand Down Expand Up @@ -212,8 +208,7 @@ private:
display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT,
DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y,
DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

// MCP Tools 初始化
Expand All @@ -232,12 +227,6 @@ public:
GetBacklight()->SetBrightness(100);
}

// 动态加载资源文件(包括字体、唤醒词、表情包)
virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
return &assets;
}

// 获取音频编解码器
virtual AudioCodec* GetAudioCodec() override {
static Es8311AudioCodec audio_codec(
Expand Down
13 changes: 1 addition & 12 deletions main/boards/atk-dnesp32s3-box/atk_dnesp32s3_box.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@

#define TAG "atk_dnesp32s3_box"

LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);


class ATK_NoAudioCodecDuplex : public NoAudioCodec {
public:
ATK_NoAudioCodecDuplex(int input_sample_rate, int output_sample_rate, gpio_num_t bclk, gpio_num_t ws, gpio_num_t dout, gpio_num_t din) {
Expand Down Expand Up @@ -84,7 +80,6 @@ class ATK_NoAudioCodecDuplex : public NoAudioCodec {
}
};


class XL9555_IN : public I2cDevice {
public:
XL9555_IN(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) {
Expand Down Expand Up @@ -243,8 +238,7 @@ class atk_dnesp32s3_box : public WifiBoard {
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel, true));

display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

void InitializeButtons() {
Expand All @@ -266,11 +260,6 @@ class atk_dnesp32s3_box : public WifiBoard {
InitializeButtons();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
/* 根据探测结果初始化编解码器 */
if (es8311_detected_) {
Expand Down
12 changes: 1 addition & 11 deletions main/boards/atk-dnesp32s3-box0/atk_dnesp32s3_box0.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

#define TAG "atk_dnesp32s3_box0"

LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);

class atk_dnesp32s3_box0 : public WifiBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -294,7 +291,6 @@ class atk_dnesp32s3_box0 : public WifiBoard {
GetDisplay()->ShowNotification(Lang::Strings::MAX_VOLUME);
});


}

void InitializeSt7789Display() {
Expand Down Expand Up @@ -325,8 +321,7 @@ class atk_dnesp32s3_box0 : public WifiBoard {
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);

display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

public:
Expand All @@ -344,11 +339,6 @@ class atk_dnesp32s3_box0 : public WifiBoard {
GetBacklight()->RestoreBrightness();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
static Es8311AudioCodec audio_codec(
i2c_bus_,
Expand Down
11 changes: 1 addition & 10 deletions main/boards/atk-dnesp32s3-box2-4g/atk_dnesp32s3_box2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

#define TAG "atk_dnesp32s3_box2_4g"

LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);

class atk_dnesp32s3_box2_4g : public DualNetworkBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -412,8 +409,7 @@ class atk_dnesp32s3_box2_4g : public DualNetworkBoard {
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);

display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

public:
Expand All @@ -429,11 +425,6 @@ class atk_dnesp32s3_box2_4g : public DualNetworkBoard {
InitializeBoardPowerManager();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
static Es8389AudioCodec audio_codec(
i2c_bus_,
Expand Down
11 changes: 1 addition & 10 deletions main/boards/atk-dnesp32s3-box2-wifi/atk_dnesp32s3_box2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@

#define TAG "atk_dnesp32s3_box2_wifi"

LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);

class atk_dnesp32s3_box2_wifi : public WifiBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -392,8 +389,7 @@ class atk_dnesp32s3_box2_wifi : public WifiBoard {
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);

display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

public:
Expand All @@ -408,11 +404,6 @@ class atk_dnesp32s3_box2_wifi : public WifiBoard {
InitializeBoardPowerManager();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
static Es8389AudioCodec audio_codec(
i2c_bus_,
Expand Down
12 changes: 1 addition & 11 deletions main/boards/atk-dnesp32s3/atk_dnesp32s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#define TAG "atk_dnesp32s3"

LV_FONT_DECLARE(font_puhui_basic_20_4);
LV_FONT_DECLARE(font_awesome_20_4);

class XL9555 : public I2cDevice {
public:
XL9555(i2c_master_bus_handle_t i2c_bus, uint8_t addr) : I2cDevice(i2c_bus, addr) {
Expand Down Expand Up @@ -47,7 +44,6 @@ class XL9555 : public I2cDevice {
}
};


class atk_dnesp32s3 : public WifiBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -131,8 +127,7 @@ class atk_dnesp32s3 : public WifiBoard {
esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY);
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_20_4, &font_awesome_20_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

// 初始化摄像头:ov2640;
Expand Down Expand Up @@ -201,11 +196,6 @@ class atk_dnesp32s3 : public WifiBoard {
InitializeCamera();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_20_4_EMOJI_64);
return &assets;
}

virtual Led* GetLed() override {
static SingleLed led(BUILTIN_LED_GPIO);
return &led;
Expand Down
11 changes: 1 addition & 10 deletions main/boards/atk-dnesp32s3m-4g/atk_dnesp32s3m.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@

#define TAG "atk_dnesp32s3m_4g"

LV_FONT_DECLARE(font_puhui_basic_16_4);
LV_FONT_DECLARE(font_awesome_16_4);

class atk_dnesp32s3m_4g : public Ml307Board {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -167,8 +164,7 @@ class atk_dnesp32s3m_4g : public Ml307Board {
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);

display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_16_4, &font_awesome_16_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

public:
Expand All @@ -186,11 +182,6 @@ class atk_dnesp32s3m_4g : public Ml307Board {
}
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
return &assets;
}

virtual Led* GetLed() override {
static SingleLed led(BUILTIN_LED_GPIO);
return &led;
Expand Down
11 changes: 1 addition & 10 deletions main/boards/atk-dnesp32s3m-wifi/atk_dnesp32s3m.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@

#define TAG "atk_dnesp32s3m_wifi"

LV_FONT_DECLARE(font_puhui_basic_16_4);
LV_FONT_DECLARE(font_awesome_16_4);

class atk_dnesp32s3m_wifi : public WifiBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -177,8 +174,7 @@ class atk_dnesp32s3m_wifi : public WifiBoard {
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);

display_ = new SpiLcdDisplay(panel_io, panel,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_16_4, &font_awesome_16_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

public:
Expand All @@ -196,11 +192,6 @@ class atk_dnesp32s3m_wifi : public WifiBoard {
}
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
return &assets;
}

virtual Led* GetLed() override {
static SingleLed led(BUILTIN_LED_GPIO);
return &led;
Expand Down
6 changes: 0 additions & 6 deletions main/boards/atom-echos3r/atom_echos3r.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

#define TAG "AtomEchoS3R"


class AtomEchoS3rBaseBoard : public WifiBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -71,11 +70,6 @@ class AtomEchoS3rBaseBoard : public WifiBoard {
InitializeButtons();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_WAKENET);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
static Es8311AudioCodec audio_codec(
i2c_bus_,
Expand Down
2 changes: 0 additions & 2 deletions main/boards/atommatrix-echo-base/atommatrix_echo_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class Pi4ioe : public I2cDevice {
}
};


class AtomMatrixEchoBaseBoard : public WifiBoard {
private:
i2c_master_bus_handle_t i2c_bus_;
Expand Down Expand Up @@ -87,7 +86,6 @@ class AtomMatrixEchoBaseBoard : public WifiBoard {
pi4ioe_->SetSpeakerMute(false);
}


void InitializeButtons() {
face_button_.OnClick([this]() {

Expand Down
12 changes: 1 addition & 11 deletions main/boards/atoms3-echo-base/atoms3_echo_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

#define TAG "AtomS3+EchoBase"

LV_FONT_DECLARE(font_puhui_basic_16_4);
LV_FONT_DECLARE(font_awesome_16_4);

static const gc9a01_lcd_init_cmd_t gc9107_lcd_init_cmds[] = {
// {cmd, { data }, data_size, delay_ms}
{0xfe, (uint8_t[]){0x00}, 0, 0},
Expand Down Expand Up @@ -176,10 +173,8 @@ class AtomS3EchoBaseBoard : public WifiBoard {
ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle));
ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true));


display_ = new SpiLcdDisplay(io_handle, panel_handle,
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY,
{&font_puhui_basic_16_4, &font_awesome_16_4});
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
}

void InitializeButtons() {
Expand All @@ -203,11 +198,6 @@ class AtomS3EchoBaseBoard : public WifiBoard {
GetBacklight()->RestoreBrightness();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_PUHUI_COMMON_16_4_EMOJI_32);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
static Es8311AudioCodec audio_codec(
i2c_bus_,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ class AtomS3rCamM12EchoBaseBoard : public WifiBoard {
InitializePi4ioe();
}

virtual Assets* GetAssets() override {
static Assets assets(ASSETS_XIAOZHI_WAKENET);
return &assets;
}

virtual AudioCodec* GetAudioCodec() override {
static Es8311AudioCodec audio_codec(
i2c_bus_,
Expand Down
Loading
Loading