Baji_Rtc_Toy/main/dzbj/dzbj_init.c
Rdzleo 58c33e3cb4 feat: AI对话模式emoji表情系统 + 中文字体 + 分区优化
1. 新增AI对话LVGL界面(ai_chat_ui),支持emoji图片 + 状态文本 + 聊天消息
2. 新增7个emoji表情资源(64×64 PNG C数组):neutral/happy/sad/angry/crying/funny/laughing
3. 新增阿里巴巴普惠体20px 4bpp中文字体(GB2312字符集)
4. 利用火山RTC会话状态(VOLC_MSG_CONV_STATUS)驱动emoji切换:
   - LISTENING→happy, THINKING→neutral, ANSWERING→laughing
   - INTERRUPTED→funny, ANSWER_FINISH→happy
5. 设备状态emoji映射:Listening→happy, Speaking→laughing, Dialog→happy
6. 配网模式显示happy emoji
7. 分区优化:model 3MB→64KB,OTA 5MB→6.5MB
8. 编译优化:-Og→-Os,移除SimSun CJK字体

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 18:14:19 +08:00

51 lines
1.3 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "dzbj_init.h"
#include "dzbj_gpio.h"
#include "lcd.h"
#include "pages_pwm.h"
#include "ui/ui.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#define TAG "DZBJ"
// 仅硬件+LVGL 初始化(不加载 SquareLine UI不点亮背光
void dzbj_hw_display_init(i2c_master_bus_handle_t i2c_bus) {
ESP_LOGI(TAG, "开始初始化显示硬件...");
// 1. LCD 硬件初始化QSPI ST77916
lcd_init();
ESP_LOGI(TAG, "LCD 硬件初始化完成");
#if DZBJ_ENABLE_TOUCH
// 2. 传入 I2C 总线句柄(与音频编解码器共享)
lcd_set_i2c_bus(i2c_bus);
// 3. 触摸控制器初始化CST816S
touch_init();
#else
(void)i2c_bus;
ESP_LOGI(TAG, "屏幕触摸已禁用 (DZBJ_ENABLE_TOUCH=0)");
#endif
// 4. LVGL 初始化(显示)
lvgl_lcd_init();
ESP_LOGI(TAG, "LVGL 初始化完成");
}
// 完整初始化(硬件+LVGL + SquareLine UI + 背光)
void dzbj_display_init(i2c_master_bus_handle_t i2c_bus) {
dzbj_hw_display_init(i2c_bus);
// SquareLine UI 初始化
ui_init();
ESP_LOGI(TAG, "UI 初始化完成");
// 等待首帧渲染完成
vTaskDelay(pdMS_TO_TICKS(100));
// 点亮背光
pwm_init();
ESP_LOGI(TAG, "背光已点亮dzbj 显示模块初始化完成");
}