xtensa/esp32: initialize RTC in case PM or RTC configs are not set, but RWDT is.

This commit is contained in:
Sara Souza
2021-08-03 08:31:39 -03:00
committed by Alan Carvalho de Assis
parent d7cb4567e6
commit 67d29e7537
+12
View File
@@ -932,6 +932,18 @@ FAR struct esp32_wdt_dev_s *esp32_wdt_init(uint8_t wdt_id)
case 2: case 2:
{ {
wdt = &g_esp32_rwdt_priv; wdt = &g_esp32_rwdt_priv;
/* If RTC was not initialized in a previous
* stage by the PM or by clock_initialize()
* Then, init the RTC clock configuration here.
*/
#if !defined(CONFIG_PM) && !defined(CONFIG_RTC)
/* Initialize RTC controller parameters */
esp32_rtc_init();
esp32_rtc_clk_set();
#endif
break; break;
} }