From 6f6cbf1d1eb988a19fc990446827e172e7c6791c Mon Sep 17 00:00:00 2001 From: Johnny Hsu Date: Sat, 2 Nov 2024 17:31:54 +0100 Subject: [PATCH] add STM32F042x6 --- can-halal.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/can-halal.h b/can-halal.h index 8351424..766b1cd 100644 --- a/can-halal.h +++ b/can-halal.h @@ -2,7 +2,7 @@ #define CAN_HALAL_H // Define family macros if none are defined and we recognize a chip macro -#if !defined(STM32F3) && !defined(STM32H7) +#if !defined(STM32F3) && !defined(STM32H7) && !defined(STM32F0) #if defined(STM32F302x6) || defined(STM32F302x8) || defined(STM32F302xB) || \ defined(STM32F302xC) #define STM32F3 @@ -10,20 +10,27 @@ #if defined(STM32H7A3xx) #define STM32H7 #endif +#if defined(STM32F042x6) +#define STM32F0 +#endif #endif #if defined(STM32F3) -#include "stm32f3xx_hal.h" -#define FTCAN_IS_BXCAN -#define FTCAN_NUM_FILTERS 13 + #include "stm32f3xx_hal.h" + #define FTCAN_IS_BXCAN + #define FTCAN_NUM_FILTERS 13 #elif defined(STM32H7) -#include "stm32h7xx_hal.h" -#define FTCAN_IS_FDCAN -#ifndef FTCAN_NUM_FILTERS - #error "Please configure the number of filters in CubeMX, and then add a compiler define for FTCAN_NUM_FILTERS" -#endif + #include "stm32h7xx_hal.h" + #define FTCAN_IS_FDCAN + #ifndef FTCAN_NUM_FILTERS + #error "Please configure the number of filters in CubeMX, and then add a compiler define for FTCAN_NUM_FILTERS" + #endif +#elif defined(STM32F0) + #include "stm32f0xx_hal.h" + #define FTCAN_IS_BXCAN + #define FTCAN_NUM_FILTERS 13 #else -#error "Couldn't detect STM family" + #error "Couldn't detect STM family" #endif #if defined(FTCAN_IS_BXCAN)