From d5e4fb2517b47a6a507fb765d3c78ea46b80f430 Mon Sep 17 00:00:00 2001 From: Dimitris Mantzouranis Date: Wed, 9 Feb 2022 13:06:56 +0200 Subject: [PATCH] 2xx: fix the interrupt priorities ARM M0 supports interrupt priorities 1-3 --- os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_pwm_lld.h | 2 +- os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c | 2 +- os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.h | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_pwm_lld.h b/os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_pwm_lld.h index 61162df63c..7c6ea68958 100644 --- a/os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_pwm_lld.h +++ b/os/hal/ports/SN32/LLD/SN32F2xx/CT/hal_pwm_lld.h @@ -61,7 +61,7 @@ * @brief PWMD1 interrupt priority level setting. */ #if !defined(SN32_PWM_CT16B1_IRQ_PRIORITY) || defined(__DOXYGEN__) -#define SN32_PWM_CT16B1_IRQ_PRIORITY 3 +#define SN32_PWM_CT16B1_IRQ_PRIORITY 2 #endif /** @} */ diff --git a/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c b/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c index d54684aa49..863a7f1ea9 100644 --- a/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c +++ b/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.c @@ -653,7 +653,7 @@ void usb_lld_start(USBDriver *usbp) { #if PLATFORM_USB_USE_USB1 == TRUE if (&USBD1 == usbp) { USB_Init(); - nvicEnableVector(SN32_USB_NUMBER, 14); + nvicEnableVector(SN32_USB_NUMBER, SN32_USB_IRQ_PRIORITY); } #endif } diff --git a/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.h b/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.h index 5f0a230b9b..46437cd600 100644 --- a/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.h +++ b/os/hal/ports/SN32/LLD/SN32F2xx/USB/hal_usb_lld.h @@ -65,6 +65,13 @@ #if !defined(PLATFORM_USB_USE_USB1) || defined(__DOXYGEN__) #define PLATFORM_USB_USE_USB1 TRUE #endif + +/** + * @brief USB interrupt priority level setting. + */ +#if !defined(SN32_USB_IRQ_PRIORITY) || defined(__DOXYGEN__) +#define SN32_USB_IRQ_PRIORITY 3 +#endif /** @} */ /*===========================================================================*/