forked from xiaozhi/xiaozhi-esp32
fix: fixed the issue of slow startup for devices without cameras (#866)
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions/v1/32m.csv\"",
|
||||
"CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y",
|
||||
"CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n",
|
||||
"CONFIG_IDF_EXPERIMENTAL_FEATURES=y"
|
||||
"CONFIG_IDF_EXPERIMENTAL_FEATURES=y",
|
||||
"CONFIG_FREERTOS_HZ=1000"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y",
|
||||
"CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n",
|
||||
"CONFIG_IDF_EXPERIMENTAL_FEATURES=y",
|
||||
"CONFIG_FREERTOS_HZ=1000",
|
||||
"CONFIG_LANGUAGE_EN_US=y",
|
||||
"CONFIG_SR_WN_WN9_JARVIS_TTS=y"
|
||||
]
|
||||
|
||||
@@ -548,9 +548,9 @@ public:
|
||||
InitializeButton();
|
||||
InitializeKnob();
|
||||
Initializespd2010Display();
|
||||
GetBacklight()->RestoreBrightness(); // 对于不带摄像头的版本,InitializeCamera需要3s, 所以先恢复背光亮度
|
||||
InitializeCamera();
|
||||
InitializeIot();
|
||||
GetBacklight()->RestoreBrightness();
|
||||
}
|
||||
|
||||
virtual AudioCodec* GetAudioCodec() override {
|
||||
|
||||
@@ -83,6 +83,16 @@ SscmaCamera::SscmaCamera(esp_io_expander_handle_t io_exp_handle) {
|
||||
|
||||
sscma_client_init(sscma_client_handle_);
|
||||
|
||||
ESP_LOGI(TAG, "SSCMA client initialized");
|
||||
// 设置分辨率
|
||||
// 3 = 640x480
|
||||
if (sscma_client_set_sensor(sscma_client_handle_, 1, 3, true)) {
|
||||
ESP_LOGE(TAG, "Failed to set sensor");
|
||||
sscma_client_del(sscma_client_handle_);
|
||||
sscma_client_handle_ = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取设备信息
|
||||
sscma_client_info_t *info;
|
||||
if (sscma_client_get_info(sscma_client_handle_, &info, true) == ESP_OK) {
|
||||
@@ -90,8 +100,6 @@ SscmaCamera::SscmaCamera(esp_io_expander_handle_t io_exp_handle) {
|
||||
info->id ? info->id : "NULL",
|
||||
info->name ? info->name : "NULL");
|
||||
}
|
||||
sscma_client_set_sensor(sscma_client_handle_, 1, 3, true); // 3 = 640x480
|
||||
|
||||
// 初始化JPEG数据的内存
|
||||
jpeg_data_.len = 0;
|
||||
jpeg_data_.buf = (uint8_t*)heap_caps_malloc(IMG_JPEG_BUF_SIZE, MALLOC_CAP_SPIRAM);;
|
||||
|
||||
Reference in New Issue
Block a user