Skip to content

Commit d8d330d

Browse files
committed
add watchdog driver
1 parent 72806a2 commit d8d330d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/fw/drivers/task_watchdog.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static uint8_t s_ticks_since_successful_feed = 0;
8484
#define WATCHDOG_FREERTOS_IRQHandler EGU5_SWI5_IRQHandler
8585
#elif MICRO_FAMILY_SF32LB
8686
#define WATCHDOG_FREERTOS_IRQn 2
87-
#define WATCHDOG_FREERTOS_IRQHandler NMI_Handler2
87+
#define WATCHDOG_FREERTOS_IRQHandler NMI_Handler2
8888
#else
8989
#define WATCHDOG_FREERTOS_IRQn CAN2_SCE_IRQn
9090
#define WATCHDOG_FREERTOS_IRQHandler CAN2_SCE_IRQHandler
@@ -291,6 +291,11 @@ void task_watchdog_init(void) {
291291

292292
nrf_rtc_task_trigger(NRF_RTC2, NRF_RTC_TASK_START);
293293
#elif MICRO_FAMILY_SF32LB
294+
295+
//watchdog_init();
296+
//watchdog_start();
297+
298+
294299
#else
295300
// The timer is on ABP1 which is clocked by PCLK1
296301
RCC_ClocksTypeDef clocks;
@@ -341,6 +346,8 @@ void task_watchdog_init(void) {
341346
#if MICRO_FAMILY_NRF5
342347
NVIC_SetPriority(WATCHDOG_FREERTOS_IRQn, configMAX_SYSCALL_INTERRUPT_PRIORITY);
343348
#elif MICRO_FAMILY_SF32LB
349+
HAL_NVIC_SetPriority(WATCHDOG_FREERTOS_IRQn, 5, 0);
350+
344351
#else
345352
NVIC_InitStructure.NVIC_IRQChannel = WATCHDOG_FREERTOS_IRQn;
346353
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = configMAX_SYSCALL_INTERRUPT_PRIORITY >> 4;

0 commit comments

Comments
 (0)