File tree Expand file tree Collapse file tree 3 files changed +17
-12
lines changed
libraries/SrcWrapper/src/stm32 Expand file tree Collapse file tree 3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 2828 #undef HAL_ADC_MODULE_ENABLED
2929#endif
3030
31+ #if !defined(HAL_CRC_MODULE_DISABLED )
32+ #define HAL_CRC_MODULE_ENABLED
33+ #else
34+ #undef HAL_CRC_MODULE_ENABLED
35+ #endif
36+
3137#if !defined(HAL_I2C_MODULE_DISABLED )
3238 #define HAL_I2C_MODULE_ENABLED
3339#else
7076 #undef HAL_ICACHE_MODULE_ENABLED
7177#endif
7278
73- #if !defined(HAL_CRC_MODULE_ENABLED )
74- #define HAL_CRC_MODULE_ENABLED
75- #else
76- #undef HAL_CRC_MODULE_ENABLED
77- #endif
78-
7979/*
8080 * Not defined by default
8181 */
Original file line number Diff line number Diff line change @@ -174,12 +174,14 @@ void configIPClock(void)
174174 __HAL_RCC_SYSCFG_CLK_ENABLE ();
175175#endif
176176
177+ #if defined(HAL_CRC_MODULE_ENABLED )
177178 /* Enable CRC clock, needed for example: MotionFX Library ... */
178179#if defined(__HAL_RCC_CRC2_CLK_ENABLE )
179180 __HAL_RCC_CRC2_CLK_ENABLE ();
180181#elif defined(__HAL_RCC_CRC_CLK_ENABLE )
181182 __HAL_RCC_CRC_CLK_ENABLE ();
182183#endif
184+ #endif
183185}
184186
185187#ifdef __cplusplus
Original file line number Diff line number Diff line change 1919extern "C" {
2020#endif
2121
22- #ifdef CRC2_BASE
23- #define CRC_INSTANCE CRC2
22+ #if defined(HAL_CRC_MODULE_ENABLED )
23+ CRC_HandleTypeDef hcrc = {.Instance =
24+ #if defined(CRC2_BASE )
25+ CRC2
2426#elif defined(CRC_BASE )
25- #define CRC_INSTANCE CRC
27+ CRC
2628#else
27- #error "No CRC instance available"
29+ #error "No CRC instance available!"
30+ #endif
31+ };
2832#endif
29- CRC_HandleTypeDef hcrc = {.Instance = CRC_INSTANCE };
3033
3134/**
3235 * @brief This function performs the global init of the system (HAL, IOs...)
@@ -63,7 +66,7 @@ void hw_config_init(void)
6366 SystemClock_Config ();
6467
6568 /* Initialize the CRC */
66- #if defined(CRC_INSTANCE )
69+ #if defined(HAL_CRC_MODULE_ENABLED )
6770 HAL_CRC_Init (& hcrc );
6871#endif
6972
You can’t perform that action at this time.
0 commit comments