OS: add some features for audio_idf

1. enable mclk when enter light sleep
2. add an get error API for esp_http_client
3. websocket migration and fix some issue (from release/v4.0)
This commit is contained in:
xutao
2020-07-21 21:01:11 +08:00
parent f00a598153
commit f745642042
24 changed files with 2066 additions and 47 deletions

View File

@@ -213,6 +213,21 @@ static uint32_t IRAM_ATTR esp_sleep_start(uint32_t pd_flags)
s_config.sleep_duration > 0) {
timer_wakeup_prepare();
}
/**
* This is only available in light sleep mode and esp32 is required to provide MCLK to i2c slave device
* The current may be as large as 2mA to 3mA after enabling compared with light sleep when this is not added
*/
REG_CLR_BIT(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_I2C_FORCE_PD);
REG_SET_BIT(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_I2C_FORCE_PU);
REG_CLR_BIT(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_FORCE_SLEEP);
REG_SET_BIT(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_BIAS_FORCE_NOSLEEP);
REG_CLR_BIT(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_XTL_FORCE_PD);
REG_SET_BIT(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_XTL_FORCE_PU);
REG_CLR_BIT(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PD);
REG_SET_BIT(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_PLLA_FORCE_PU);
REG_CLR_BIT(RTC_CNTL_PWC_REG, RTC_CNTL_PD_EN);
uint32_t result = rtc_sleep_start(s_config.wakeup_triggers, 0);
// Restore CPU frequency