Skip to content

Commit 43ef2f4

Browse files
feat: Add emote support for lichuang-dev (#1337)
1 parent 3f54330 commit 43ef2f4

File tree

4 files changed

+74
-4
lines changed

4 files changed

+74
-4
lines changed

main/Kconfig.projbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ choice DISPLAY_STYLE
556556

557557
config USE_EMOTE_MESSAGE_STYLE
558558
bool "Emote animation style"
559-
depends on BOARD_TYPE_ESP_BOX_3 || BOARD_TYPE_ECHOEAR
559+
depends on BOARD_TYPE_ESP_BOX_3 || BOARD_TYPE_ECHOEAR || BOARD_TYPE_LICHUANG_DEV_S3
560560
endchoice
561561

562562
choice WAKE_WORD_TYPE
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{"emote": "happy", "src": "Happy.eaf", "loop": true, "fps": 20},
3+
{"emote": "laughing", "src": "Happy.eaf", "loop": true, "fps": 20},
4+
{"emote": "funny", "src": "Happy.eaf", "loop": true, "fps": 20},
5+
{"emote": "loving", "src": "Happy.eaf", "loop": true, "fps": 20},
6+
{"emote": "embarrassed", "src": "Happy.eaf", "loop": true, "fps": 20},
7+
{"emote": "confident", "src": "Happy.eaf", "loop": true, "fps": 20},
8+
{"emote": "delicious", "src": "Happy.eaf", "loop": true, "fps": 20},
9+
{"emote": "sad", "src": "Sad.eaf", "loop": true, "fps": 20},
10+
{"emote": "crying", "src": "cry.eaf", "loop": true, "fps": 20},
11+
{"emote": "sleepy", "src": "sleep.eaf", "loop": true, "fps": 20},
12+
{"emote": "silly", "src": "Happy.eaf", "loop": true, "fps": 20},
13+
{"emote": "angry", "src": "angry.eaf", "loop": true, "fps": 20},
14+
{"emote": "surprised", "src": "Happy.eaf", "loop": true, "fps": 20},
15+
{"emote": "shocked", "src": "shocked.eaf", "loop": true, "fps": 20},
16+
{"emote": "thinking", "src": "confused.eaf", "loop": true, "fps": 20},
17+
{"emote": "winking", "src": "neutral.eaf", "loop": true, "fps": 20},
18+
{"emote": "relaxed", "src": "Happy.eaf", "loop": true, "fps": 20},
19+
{"emote": "confused", "src": "confused.eaf", "loop": true, "fps": 20},
20+
{"emote": "neutral", "src": "winking.eaf", "loop": false, "fps": 20},
21+
{"emote": "idle", "src": "neutral.eaf", "loop": false, "fps": 20}
22+
]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[
2+
{
3+
"name": "eye_anim",
4+
"align": "GFX_ALIGN_LEFT_MID",
5+
"x": 10,
6+
"y": 30
7+
},
8+
{
9+
"name": "status_icon",
10+
"align": "GFX_ALIGN_TOP_MID",
11+
"x": -120,
12+
"y": 18
13+
},
14+
{
15+
"name": "toast_label",
16+
"align": "GFX_ALIGN_TOP_MID",
17+
"x": 0,
18+
"y": 20,
19+
"width": 200,
20+
"height": 40
21+
},
22+
{
23+
"name": "clock_label",
24+
"align": "GFX_ALIGN_TOP_MID",
25+
"x": 0,
26+
"y": 20,
27+
"width": 200,
28+
"height": 50
29+
},
30+
{
31+
"name": "listen_anim",
32+
"align": "GFX_ALIGN_TOP_MID",
33+
"x": 0,
34+
"y": 5
35+
}
36+
]
37+

main/boards/lichuang-dev/lichuang_dev_board.cc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "wifi_board.h"
22
#include "codecs/box_audio_codec.h"
33
#include "display/lcd_display.h"
4+
#include "display/emote_display.h"
45
#include "application.h"
56
#include "button.h"
67
#include "config.h"
@@ -68,7 +69,7 @@ class LichuangDevBoard : public WifiBoard {
6869
i2c_master_bus_handle_t i2c_bus_;
6970
i2c_master_dev_handle_t pca9557_handle_;
7071
Button boot_button_;
71-
LcdDisplay* display_;
72+
Display* display_;
7273
Pca9557* pca9557_;
7374
Esp32Camera* camera_;
7475

@@ -152,8 +153,14 @@ class LichuangDevBoard : public WifiBoard {
152153
esp_lcd_panel_invert_color(panel, true);
153154
esp_lcd_panel_swap_xy(panel, DISPLAY_SWAP_XY);
154155
esp_lcd_panel_mirror(panel, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y);
156+
esp_lcd_panel_disp_on_off(panel, true);
157+
158+
#if CONFIG_USE_EMOTE_MESSAGE_STYLE
159+
display_ = new emote::EmoteDisplay(panel, panel_io, DISPLAY_WIDTH, DISPLAY_HEIGHT);
160+
#else
155161
display_ = new SpiLcdDisplay(panel_io, panel,
156-
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
162+
DISPLAY_WIDTH, DISPLAY_HEIGHT, DISPLAY_OFFSET_X, DISPLAY_OFFSET_Y, DISPLAY_MIRROR_X, DISPLAY_MIRROR_Y, DISPLAY_SWAP_XY);
163+
#endif
157164
}
158165

159166
void InitializeTouch()
@@ -188,7 +195,11 @@ class LichuangDevBoard : public WifiBoard {
188195
.handle = tp,
189196
};
190197

191-
lvgl_port_add_touch(&touch_cfg);
198+
if(touch_cfg.disp) {
199+
lvgl_port_add_touch(&touch_cfg);
200+
} else {
201+
ESP_LOGE(TAG, "Touch display is not initialized");
202+
}
192203
}
193204

194205
void InitializeCamera() {

0 commit comments

Comments
 (0)