guard uninited semaphore use in IRQ

This commit is contained in:
Oskar Weigl
2017-03-01 20:43:41 +01:00
parent 46e37f1eb5
commit 9ce886a258
+3 -1
View File
@@ -203,7 +203,9 @@ void OTG_FS_IRQHandler(void)
// Mask interrupt, and signal processing of interrupt by usb_cmd_thread
// The thread will re-enable the interrupt when all pending irqs are clear.
HAL_NVIC_DisableIRQ(OTG_FS_IRQn);
osSemaphoreRelease(sem_usb_irq);
if (sem_usb_irq) {
osSemaphoreRelease(sem_usb_irq);
}
// Bypass interrupt processing here
return;