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:
Wangjialin
2016-11-23 02:15:27 +08:00
parent d0c9c1de57
commit a3c4a70ba3
6 changed files with 841 additions and 2 deletions

View File

@@ -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