espressif / esp-adf

Espressif Audio Development Framework
Other
1.53k stars 671 forks source link

sr_recorder: fix recorder_sr_reset_speech_cmd on ESP32-S3 (AUD-4695) #1028

Closed stintel closed 1 year ago

stintel commented 1 year ago

Since ESP-SR commit 62b626f3f642 ("Update multinet API to add/modify/print/check new commmand string"), 400 multinet commands are supported on ESP32-S3. The max value for uint8_t is 255, which is lower than 400. This causes the following warning:

/willow/deps/esp-adf/components/audio_recorder/recorder_sr.c: In function 'recorder_sr_reset_speech_cmd': /willow/deps/esp-adf/components/audio_recorder/recorder_sr.c:613:22: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (++cmd_id > ESP_MN_MAX_PHRASE_NUM) { ^

Change cmd_id to uint16_t to fix this.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

JosephTang commented 1 year ago

ESP-ADF has no plan to update the branch of esp-sr in the near further, but this modification is useful and can be merged if you can update the commit message, make it no mention of the version of esp-sr, thanks.

stintel commented 1 year ago

make it no mention of the version of esp-sr

Not exactly sure what you mean. Can you elaborate?

jason-mao commented 1 year ago

@stintel Thank you for your contribution. We have noted the latest sr increase the ESP_MN_MAX_PHRASE_NUM from 200 to 400. I will merge and fix.

jason-mao commented 1 year ago

Merged on 9f2dd79d0636d5637afb353b46db13048025e3dc