xtensa/esp32s2: fix for timers and watchdog init on startup
This commit is contained in:
parent
2e884cbd11
commit
4915338857
@ -39,6 +39,9 @@
|
||||
#include "hardware/esp32s2_systimer.h"
|
||||
#include "hardware/esp32s2_tim.h"
|
||||
|
||||
#include "soc/periph_defs.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@ -1254,6 +1257,15 @@ struct esp32s2_tim_dev_s *esp32s2_tim_init(int timer)
|
||||
#endif
|
||||
}
|
||||
|
||||
if (tim->gid == GROUP0)
|
||||
{
|
||||
periph_module_enable(PERIPH_TIMG0_MODULE);
|
||||
}
|
||||
else
|
||||
{
|
||||
periph_module_enable(PERIPH_TIMG1_MODULE);
|
||||
}
|
||||
|
||||
/* Verify if it is in use */
|
||||
|
||||
if (tim->inuse == false)
|
||||
|
@ -38,6 +38,9 @@
|
||||
#include "hardware/esp32s2_rtccntl.h"
|
||||
#include "hardware/esp32s2_tim.h"
|
||||
|
||||
#include "soc/periph_defs.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@ -1042,6 +1045,7 @@ struct esp32s2_wdt_dev_s *esp32s2_wdt_init(enum esp32s2_wdt_inst_e wdt_id)
|
||||
}
|
||||
else
|
||||
{
|
||||
periph_module_enable(PERIPH_TIMG1_MODULE);
|
||||
wdt->inuse = true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user