mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-25 09:42:35 +00:00
driver: timer
1. minor modifications 2. use TIMG_WDT_INT_ENA_M instead of BIT(2) in wdt.c 3. add doc/api/timer.rst
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "esp_freertos_hooks.h"
|
||||
#include "soc/timer_group_struct.h"
|
||||
#include "soc/timer_group_reg.h"
|
||||
#include "driver/timer.h"
|
||||
|
||||
#include "esp_int_wdt.h"
|
||||
|
||||
@@ -85,7 +86,7 @@ void esp_int_wdt_init() {
|
||||
TIMERG1.wdt_feed=1;
|
||||
TIMERG1.wdt_wprotect=0;
|
||||
TIMERG1.int_clr_timers.wdt=1;
|
||||
TIMERG1.int_ena.wdt=1;
|
||||
timer_group_intr_enable(TIMER_GROUP_1, TIMG_WDT_INT_ENA_M);
|
||||
esp_register_freertos_tick_hook(tick_hook);
|
||||
ESP_INTR_DISABLE(WDT_INT_NUM);
|
||||
intr_matrix_set(xPortGetCoreID(), ETS_TG1_WDT_LEVEL_INTR_SOURCE, WDT_INT_NUM);
|
||||
@@ -97,4 +98,4 @@ void esp_int_wdt_init() {
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -205,7 +205,7 @@ 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;
|
||||
timer_group_intr_enable(TIMER_GROUP_0, BIT(2));
|
||||
timer_group_intr_enable(TIMER_GROUP_0, TIMG_WDT_INT_ENA_M);
|
||||
ESP_INTR_ENABLE(ETS_T0_WDT_INUM);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user