Skip to content

Commit ebb6c4c

Browse files
committed
Merge branch 'fix/fix_sleep_reject_on_esp32' into 'master'
fix(esp_hw_support): fix short duration sleep requests rejected in pd_flash lightsleep Closes PM-382 See merge request espressif/esp-idf!37878
2 parents f8ecc48 + ed4813c commit ebb6c4c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

components/esp_hw_support/sleep_modes.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@
211211
#endif
212212
#endif
213213

214-
// Minimal amount of time we can sleep for
215-
#define LIGHT_SLEEP_MIN_TIME_US 200
216-
217214
#define RTC_MODULE_SLEEP_PREPARE_CYCLES (6)
218215

219216
#define CHECK_SOURCE(source, value, mask) ((s_config.wakeup_triggers & mask) && \
@@ -1447,8 +1444,8 @@ esp_err_t esp_light_sleep_start(void)
14471444
* 4. All the adjustment time which is s_config.sleep_time_adjustment below.
14481445
*/
14491446
const uint32_t vddsdio_pd_sleep_duration = MAX(FLASH_PD_MIN_SLEEP_TIME_US,
1450-
flash_enable_time_us + LIGHT_SLEEP_MIN_TIME_US + s_config.sleep_time_adjustment
1451-
+ rtc_time_slowclk_to_us(RTC_MODULE_SLEEP_PREPARE_CYCLES, s_config.rtc_clk_cal_period));
1447+
flash_enable_time_us + s_config.sleep_time_adjustment
1448+
+ rtc_time_slowclk_to_us(RTC_MODULE_SLEEP_PREPARE_CYCLES + RTC_CNTL_MIN_SLP_VAL_MIN, s_config.rtc_clk_cal_period));
14521449

14531450
if (can_power_down_vddsdio(sleep_flags, vddsdio_pd_sleep_duration)) {
14541451
if (s_config.sleep_time_overhead_out < flash_enable_time_us) {

0 commit comments

Comments
 (0)