esp32/sleep: Add a function to disable logging from ROM code

This commit is contained in:
Konstantin Kondrashov
2018-09-04 16:03:18 +08:00
parent e54f3d9616
commit 38098b713f
4 changed files with 23 additions and 2 deletions

View File

@@ -658,3 +658,13 @@ static uint32_t get_power_down_flags()
}
return pd_flags;
}
void esp_deep_sleep_disable_rom_logging(void)
{
/* To disable logging in the ROM, only the least significant bit of the register is used,
* but since this register is also used to store the frequency of the main crystal (RTC_XTAL_FREQ_REG),
* you need to write to this register in the same format.
* Namely, the upper 16 bits and lower should be the same.
*/
REG_SET_BIT(RTC_CNTL_STORE4_REG, RTC_DISABLE_ROM_LOG);
}