1. 完成了PWR按键相关的测试,测试通过
2. 完成了语言识别测试,测试基本通过,后续需要修改从sd卡导入模型以配合ota
This commit is contained in:
@@ -100,12 +100,13 @@ void test_play_one(const char *dir, const char *file)
|
||||
Music_pause();
|
||||
ESP_LOGI(TEST_TAG, "测试结束,停止播放");
|
||||
}
|
||||
|
||||
#include "tools.h"
|
||||
/*-------------------------------------------------
|
||||
* 测试入口
|
||||
*------------------------------------------------*/
|
||||
void run_audio_test(void)
|
||||
{
|
||||
create_print_sys_memory_task();
|
||||
/* 1. 初始化外设 */
|
||||
ESP_LOGI(TEST_TAG, "=== 音频测试开始 ===");
|
||||
SD_Init(); // 挂载 SD 卡
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
//
|
||||
|
||||
#include <esp_log.h>
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
#include "I2C_Driver.h"
|
||||
#include "QMI8658.h"
|
||||
@@ -249,4 +249,79 @@ void lcd_touch_lvgl_test(void)
|
||||
void gif_test(void)
|
||||
{
|
||||
gif_display_test();
|
||||
}
|
||||
|
||||
|
||||
#include "PWR_Key.h"
|
||||
static void pwr_task(void *arg)
|
||||
{
|
||||
while (true) {
|
||||
PWR_Loop(); // 电源键扫描
|
||||
vTaskDelay(pdMS_TO_TICKS(100)); // 让出 CPU,防止 WDT
|
||||
}
|
||||
}
|
||||
void pwr_key_test(void)
|
||||
{
|
||||
ESP_LOGI("PWR_KEY_TEST", "正在创建内存使用信息打印任务");
|
||||
create_print_sys_memory_task();
|
||||
|
||||
PWR_Init(); // 电源键初始化
|
||||
I2C_Init();
|
||||
LCD_Init(); // 屏幕初始化
|
||||
LVGL_Init();
|
||||
|
||||
|
||||
/* 创建独立任务 */
|
||||
xTaskCreate(pwr_task, "pwr_task", 2048, NULL, 5, NULL);
|
||||
|
||||
/* 主任务到这里就可以退出,进入 idle,WDT 不会再触发 */
|
||||
ESP_LOGI("PWR_KEY_TEST", "pwr_key_test task created");
|
||||
|
||||
while (1) {
|
||||
// raise the task priority of LVGL and/or reduce the handler period can improve the performance
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
// The task running lv_timer_handler should have lower priority than that running `lv_tick_inc`
|
||||
lv_timer_handler();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "MIC_Speech.h"
|
||||
void mic_speech_test(void)
|
||||
{
|
||||
I2C_Init();
|
||||
LCD_Init(); // 屏幕初始化
|
||||
SD_Init(); // 初始化 SD 卡以方便读出模型文件
|
||||
LVGL_Init();
|
||||
MIC_Speech_init();
|
||||
|
||||
|
||||
while (1) {
|
||||
print_sys_memory();
|
||||
// raise the task priority of LVGL and/or reduce the handler period can improve the performance
|
||||
vTaskDelay(pdMS_TO_TICKS(100));
|
||||
// The task running lv_timer_handler should have lower priority than that running `lv_tick_inc`
|
||||
lv_timer_handler();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void mic_speech_and_gif_and_music_test(void)
|
||||
{
|
||||
I2C_Init();
|
||||
LCD_Init(); // 屏幕初始化
|
||||
SD_Init(); // 初始化 SD 卡以方便读出模型文件
|
||||
LVGL_Init();
|
||||
gif_display_test_1();
|
||||
MIC_Speech_init();
|
||||
|
||||
|
||||
while (1) {
|
||||
print_sys_memory();
|
||||
// raise the task priority of LVGL and/or reduce the handler period can improve the performance
|
||||
vTaskDelay(pdMS_TO_TICKS(100));
|
||||
// The task running lv_timer_handler should have lower priority than that running `lv_tick_inc`
|
||||
lv_timer_handler();
|
||||
}
|
||||
}
|
||||
@@ -32,5 +32,14 @@ void lcd_touch_lvgl_test(void);
|
||||
// GIF测试
|
||||
void gif_test(void);
|
||||
|
||||
// PWR按键测试
|
||||
void pwr_key_test(void);
|
||||
|
||||
// 语音识别测试
|
||||
void mic_speech_test(void);
|
||||
|
||||
// 语音识别+GIF+音乐测试
|
||||
void mic_speech_and_gif_and_music_test(void);
|
||||
|
||||
|
||||
#endif //BIONIC_SPHERE_DRIVERS_TEST_H
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "SD_MMC.h"
|
||||
#include "I2C_Driver.h"
|
||||
#include "ST77916.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include <esp_log.h>
|
||||
static const char *tTAG = "GIF_TEST";
|
||||
@@ -153,6 +154,9 @@ void gif_display_test(void)
|
||||
{
|
||||
ESP_LOGI(tTAG, "======== GIF 显示测试开始 ========");
|
||||
|
||||
ESP_LOGI(tTAG, "1. 创建系统内存打印任务...");
|
||||
create_print_sys_memory_task();
|
||||
|
||||
/* 1. 初始化 SD 卡 */
|
||||
ESP_LOGI(tTAG, "1. 初始化 SD 卡...");
|
||||
SD_Init(); // 你的挂载函数
|
||||
@@ -175,4 +179,10 @@ void gif_display_test(void)
|
||||
vTaskDelay(pdMS_TO_TICKS(10));
|
||||
lv_timer_handler();
|
||||
}
|
||||
}
|
||||
|
||||
void gif_display_test_1(void) {
|
||||
ESP_LOGI(tTAG, "3. 开始显示 GIF...");
|
||||
|
||||
red_gif_test();
|
||||
}
|
||||
@@ -8,4 +8,6 @@
|
||||
|
||||
void gif_display_test(void);
|
||||
|
||||
void gif_display_test_1(void);
|
||||
|
||||
#endif //BIONIC_SPHERE_GIF_TEST_H
|
||||
Reference in New Issue
Block a user