修复model分区未初始化导致重启

This commit is contained in:
Terrence
2025-06-12 14:58:33 +08:00
parent e2777cc16b
commit 85f3f1ba9f
2 changed files with 8 additions and 1 deletions

View File

@@ -27,7 +27,10 @@ void EspWakeWord::Initialize(AudioCodec* codec) {
codec_ = codec;
wakenet_model_ = esp_srmodel_init("model");
if (wakenet_model_ == nullptr || wakenet_model_->num == -1) {
ESP_LOGE(TAG, "Failed to initialize wakenet model");
return;
}
if(wakenet_model_->num > 1) {
ESP_LOGW(TAG, "More than one model found, using the first one");
} else if (wakenet_model_->num == 0) {