Merge pull request #918 from openmv/usbdbg_fix

Fix USBDBG IRQn bug.
This commit is contained in:
Ibrahim Abd Elkader 2020-10-06 23:57:41 +02:00 committed by GitHub
commit e8ac7899f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,6 +22,12 @@
#include "runtime.h"
#include "omv_boardconfig.h"
#if MICROPY_HW_USB_HS
#define OTG_IRQn (OTG_HS_IRQn)
#else
#define OTG_IRQn (OTG_FS_IRQn)
#endif
static int xfer_bytes;
static int xfer_length;
static enum usbdbg_cmd cmd;
@ -58,9 +64,9 @@ void usbdbg_set_script_running(bool running)
inline void usbdbg_set_irq_enabled(bool enabled)
{
if (enabled) {
HAL_NVIC_EnableIRQ(OTG_FS_IRQn);
HAL_NVIC_EnableIRQ(OTG_IRQn);
} else {
HAL_NVIC_DisableIRQ(OTG_FS_IRQn);
HAL_NVIC_DisableIRQ(OTG_IRQn);
}
__DSB(); __ISB();
}