feat(esp8266): set noise timer to 3s in light sleep

This commit is contained in:
Zhang Jun Hao
2020-11-06 15:37:55 +08:00
parent 45b29e25d6
commit 22791b2b33

View File

@ -419,10 +419,13 @@ esp_err_t esp_pm_configure(const void* vconfig)
return ESP_ERR_NOT_SUPPORTED;
#endif
extern void reset_noise_timer(uint16_t interval);
const esp_pm_config_esp8266_t* config = (const esp_pm_config_esp8266_t*) vconfig;
if (config->light_sleep_enable) {
reset_noise_timer(3000);
s_sleep_mode = ESP_CPU_LIGHTSLEEP;
} else {
reset_noise_timer(100);
s_sleep_mode = ESP_CPU_WAIT;
}
return ESP_OK;