summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Conrad <[email protected]>2019-09-16 22:56:17 -0400
committerNathan Conrad <[email protected]>2019-09-16 22:56:17 -0400
commit89ffe78f84fe9771f23b51e60e539cec236a1704 (patch)
tree1d5b056a043b7032336bd2334fe3546c8c05f4ed
parenta33a8547936ccea0cfcbba8823c44cae8a887269 (diff)
ST FSDEV: No need to always reset the interrupt priority, also add some synchronization primitives after disabling interrupts.
-rw-r--r--src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
index 00a016e3b..e2df2abe4 100644
--- a/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
+++ b/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
@@ -258,12 +258,8 @@ void dcd_int_enable (uint8_t rhport)
{
(void)rhport;
#if defined(STM32F0)
- NVIC_SetPriority(USB_IRQn, 0);
NVIC_EnableIRQ(USB_IRQn);
#elif defined(STM32F3)
- NVIC_SetPriority(USB_HP_CAN_TX_IRQn, 0);
- NVIC_SetPriority(USB_LP_CAN_RX0_IRQn, 0);
- NVIC_SetPriority(USBWakeUp_IRQn, 0);
NVIC_EnableIRQ(USB_HP_CAN_TX_IRQn);
NVIC_EnableIRQ(USB_LP_CAN_RX0_IRQn);
NVIC_EnableIRQ(USBWakeUp_IRQn);
@@ -283,6 +279,10 @@ void dcd_int_disable(uint8_t rhport)
#else
#error Unknown arch in USB driver
#endif
+ // I'm not convinced that memory synchronization is completely necessary, but
+ // it isn't a bad idea.
+ __DSB();
+ __ISB();
}
// Receive Set Address request, mcu port must also include status IN response