File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 39
39
#include "hardware/esp32s2_systimer.h"
40
40
#include "hardware/esp32s2_tim.h"
41
41
42
+ #include "soc/periph_defs.h"
43
+ #include "esp_private/periph_ctrl.h"
44
+
42
45
/****************************************************************************
43
46
* Pre-processor Definitions
44
47
****************************************************************************/
@@ -1254,6 +1257,15 @@ struct esp32s2_tim_dev_s *esp32s2_tim_init(int timer)
1254
1257
#endif
1255
1258
}
1256
1259
1260
+ if (tim -> gid == GROUP0 )
1261
+ {
1262
+ periph_module_enable (PERIPH_TIMG0_MODULE );
1263
+ }
1264
+ else
1265
+ {
1266
+ periph_module_enable (PERIPH_TIMG1_MODULE );
1267
+ }
1268
+
1257
1269
/* Verify if it is in use */
1258
1270
1259
1271
if (tim -> inuse == false)
Original file line number Diff line number Diff line change 38
38
#include "hardware/esp32s2_rtccntl.h"
39
39
#include "hardware/esp32s2_tim.h"
40
40
41
+ #include "soc/periph_defs.h"
42
+ #include "esp_private/periph_ctrl.h"
43
+
41
44
/****************************************************************************
42
45
* Pre-processor Definitions
43
46
****************************************************************************/
@@ -1042,6 +1045,7 @@ struct esp32s2_wdt_dev_s *esp32s2_wdt_init(enum esp32s2_wdt_inst_e wdt_id)
1042
1045
}
1043
1046
else
1044
1047
{
1048
+ periph_module_enable (PERIPH_TIMG1_MODULE );
1045
1049
wdt -> inuse = true;
1046
1050
}
1047
1051
You can’t perform that action at this time.
0 commit comments