File tree 3 files changed +17
-12
lines changed
libraries/SrcWrapper/src/stm32
3 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 28
28
#undef HAL_ADC_MODULE_ENABLED
29
29
#endif
30
30
31
+ #if !defined(HAL_CRC_MODULE_DISABLED )
32
+ #define HAL_CRC_MODULE_ENABLED
33
+ #else
34
+ #undef HAL_CRC_MODULE_ENABLED
35
+ #endif
36
+
31
37
#if !defined(HAL_I2C_MODULE_DISABLED )
32
38
#define HAL_I2C_MODULE_ENABLED
33
39
#else
70
76
#undef HAL_ICACHE_MODULE_ENABLED
71
77
#endif
72
78
73
- #if !defined(HAL_CRC_MODULE_ENABLED )
74
- #define HAL_CRC_MODULE_ENABLED
75
- #else
76
- #undef HAL_CRC_MODULE_ENABLED
77
- #endif
78
-
79
79
/*
80
80
* Not defined by default
81
81
*/
Original file line number Diff line number Diff line change @@ -174,12 +174,14 @@ void configIPClock(void)
174
174
__HAL_RCC_SYSCFG_CLK_ENABLE ();
175
175
#endif
176
176
177
+ #if defined(HAL_CRC_MODULE_ENABLED )
177
178
/* Enable CRC clock, needed for example: MotionFX Library ... */
178
179
#if defined(__HAL_RCC_CRC2_CLK_ENABLE )
179
180
__HAL_RCC_CRC2_CLK_ENABLE ();
180
181
#elif defined(__HAL_RCC_CRC_CLK_ENABLE )
181
182
__HAL_RCC_CRC_CLK_ENABLE ();
182
183
#endif
184
+ #endif
183
185
}
184
186
185
187
#ifdef __cplusplus
Original file line number Diff line number Diff line change 19
19
extern "C" {
20
20
#endif
21
21
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
24
26
#elif defined(CRC_BASE )
25
- #define CRC_INSTANCE CRC
27
+ CRC
26
28
#else
27
- #error "No CRC instance available"
29
+ #error "No CRC instance available!"
30
+ #endif
31
+ };
28
32
#endif
29
- CRC_HandleTypeDef hcrc = {.Instance = CRC_INSTANCE };
30
33
31
34
/**
32
35
* @brief This function performs the global init of the system (HAL, IOs...)
@@ -63,7 +66,7 @@ void hw_config_init(void)
63
66
SystemClock_Config ();
64
67
65
68
/* Initialize the CRC */
66
- #if defined(CRC_INSTANCE )
69
+ #if defined(HAL_CRC_MODULE_ENABLED )
67
70
HAL_CRC_Init (& hcrc );
68
71
#endif
69
72
You can’t perform that action at this time.
0 commit comments