Some fixes to work with F103 again

sipo
Ondřej Hruška 7 years ago
parent 6f749f0198
commit b19b85e7eb
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 14
      FreeRTOSConfig.h
  2. 9
      USB/usbd_conf.c

@ -126,27 +126,27 @@ to exclude the API function. */
#define INCLUDE_xTaskGetSchedulerState 1 #define INCLUDE_xTaskGetSchedulerState 1
///* Cortex-M specific definitions. */ ///* Cortex-M specific definitions. */
//#ifdef __NVIC_PRIO_BITS
// /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
// #define configPRIO_BITS __NVIC_PRIO_BITS
//#else
// #define configPRIO_BITS 4
//#endif
#define configPRIO_BITS __NVIC_PRIO_BITS
#if (__CORTEX_M>=3) #if (__CORTEX_M>=3)
// This is for F103+
/* The lowest interrupt priority that can be used in a call to a "set priority" /* The lowest interrupt priority that can be used in a call to a "set priority"
function. */ function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
#define configPRIO_BITS 4
/* The highest interrupt priority that can be used by any interrupt service /* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */ PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
#else #else
// This is for F072
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 3 #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 3
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 3 #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 3
#define configPRIO_BITS 2
#endif #endif
/* Interrupt priorities used by the kernel port layer itself. These are generic /* Interrupt priorities used by the kernel port layer itself. These are generic

@ -82,8 +82,13 @@ void HAL_PCD_MspInit(PCD_HandleTypeDef* pcdHandle)
__HAL_RCC_USB_CLK_ENABLE(); __HAL_RCC_USB_CLK_ENABLE();
/* Peripheral interrupt init */ /* Peripheral interrupt init */
#if defined(GEX_PLAT_F103_BLUEPILL)
HAL_NVIC_SetPriority(USB_LP_CAN1_RX0_IRQn, 5, 0);
HAL_NVIC_EnableIRQ(USB_LP_CAN1_RX0_IRQn);
#elif defined(GEX_PLAT_F072_DISCOVERY)
HAL_NVIC_SetPriority(USB_IRQn, 3, 0); HAL_NVIC_SetPriority(USB_IRQn, 3, 0);
HAL_NVIC_EnableIRQ(USB_IRQn); HAL_NVIC_EnableIRQ(USB_IRQn);
#endif
/* USER CODE BEGIN USB_MspInit 1 */ /* USER CODE BEGIN USB_MspInit 1 */
/* USER CODE END USB_MspInit 1 */ /* USER CODE END USB_MspInit 1 */
@ -101,7 +106,11 @@ void HAL_PCD_MspDeInit(PCD_HandleTypeDef* pcdHandle)
__HAL_RCC_USB_CLK_DISABLE(); __HAL_RCC_USB_CLK_DISABLE();
/* Peripheral interrupt Deinit*/ /* Peripheral interrupt Deinit*/
#if defined(GEX_PLAT_F103_BLUEPILL)
HAL_NVIC_DisableIRQ(USB_LP_CAN1_RX0_IRQn);
#elif defined(GEX_PLAT_F072_DISCOVERY)
HAL_NVIC_DisableIRQ(USB_IRQn); HAL_NVIC_DisableIRQ(USB_IRQn);
#endif
/* USER CODE BEGIN USB_MspDeInit 1 */ /* USER CODE BEGIN USB_MspDeInit 1 */

Loading…
Cancel
Save