summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2020-06-16 00:03:52 +0700
committerhathach <[email protected]>2020-06-16 00:03:52 +0700
commit667eaa6dd693226d2595e2d19aa3f4798f0a4092 (patch)
treed5810b229aa3411f2eb9b8fdf409d88fe20fa440 /hw
parentc67b3a242e8873788e32bbb589836e265e8a9b53 (diff)
fix stm32h743 priority with freeRTOS
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/stm32h743eval/stm32h743eval.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/hw/bsp/stm32h743eval/stm32h743eval.c b/hw/bsp/stm32h743eval/stm32h743eval.c
index 8bafc32cb..772edf33c 100644
--- a/hw/bsp/stm32h743eval/stm32h743eval.c
+++ b/hw/bsp/stm32h743eval/stm32h743eval.c
@@ -185,10 +185,14 @@ void board_init(void)
SystemClock_Config();
all_rcc_clk_enable();
- #if CFG_TUSB_OS == OPT_OS_NONE
- // 1ms tick timer
- SysTick_Config(SystemCoreClock / 1000);
- #endif
+ // 1ms tick timer
+ SysTick_Config(SystemCoreClock / 1000);
+
+#if CFG_TUSB_OS == OPT_OS_FREERTOS
+ // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher )
+ NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
+ NVIC_SetPriority(OTG_HS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
+#endif
GPIO_InitTypeDef GPIO_InitStruct;