mirror of
https://github.com/apache/nuttx.git
synced 2026-09-13 06:00:17 +00:00
xtensa/esp32s2: fix for timers and watchdog init on startup
This commit is contained in:
parent
2e884cbd11
commit
4915338857
2 changed files with 16 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue