/* Helper function which handles entry to and exit from light sleep Placed into IRAM as flash may need some time to be powered on.  */
static esp_err_t esp_light_sleep_inner(uint32_t pd_flags, uint32_t flash_enable_time_us, rtc_vddsdio_config_t vddsdio_config) IRAM_ATTR __attribute__((noinline))
/* Helper function which handles entry to and exit from light sleep Placed into IRAM as flash may need some time to be powered on.  */
static esp_err_t esp_light_sleep_inner(uint32_t pd_flags, uint32_t flash_enable_time_us, rtc_vddsdio_config_t vddsdio_config) IRAM_ATTR __attribute__((noinline))
{
    esp_err_t err = esp_sleep_start(pd_flags);
    if (vddsdio_config.force) {
        rtc_vddsdio_set_config(vddsdio_config);
    }
    if (pd_flags & RTC_SLEEP_PD_VDDSDIO) {
        ets_delay_us(flash_enable_time_us);
    }
    return err;
}