micropython / stm32lib

STM32 Cube library - CMSIS and HAL for F4, F7 and L4 microcontrollers
63 stars 71 forks source link

STM32F413 CAN3 support incomplete #5

Closed chrismas9 closed 5 years ago

chrismas9 commented 5 years ago

@dpgeorge, Micropyhton uses stm32_hal_legacy.h definitions for CAN and CAN3 definitions are missing, eg it has #define __CAN2_CLK_ENABLE __HAL_RCC_CAN2_CLK_ENABLE but not #define __CAN3_CLK_ENABLE __HAL_RCC_CAN3_CLK_ENABLE

There are two ways to fix this. Either update stm32_hal_legacy.h or change MicroPython to directly use the definitions in stm32f4xx_hal_rcc_ex.h

Second option means no change to stm32lib. Which do you prefer?

chrismas9 commented 5 years ago

I have updated can.c to use HAL definitions

dpgeorge commented 5 years ago

I have updated can.c to use HAL definitions

Yes, that's the way I would prefer.