mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-10 04:43:33 +00:00
driver: add hardware timer code.
1. add timer driver code 2. add timer example code 3. replace api for enable interrupt in task_wdt.c
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "soc/timer_group_struct.h"
|
||||
#include "soc/timer_group_reg.h"
|
||||
#include "esp_log.h"
|
||||
#include "driver/timer.h"
|
||||
|
||||
#include "esp_task_wdt.h"
|
||||
|
||||
@@ -204,9 +205,9 @@ void esp_task_wdt_init() {
|
||||
intr_matrix_set(xPortGetCoreID(), ETS_TG0_WDT_LEVEL_INTR_SOURCE, ETS_T0_WDT_INUM);
|
||||
xt_set_interrupt_handler(ETS_T0_WDT_INUM, task_wdt_isr, NULL);
|
||||
TIMERG0.int_clr_timers.wdt=1;
|
||||
TIMERG0.int_ena.wdt=1;
|
||||
timer_group_intr_enable(TIMER_GROUP_0, BIT(2));
|
||||
ESP_INTR_ENABLE(ETS_T0_WDT_INUM);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user