File tree 3 files changed +27
-2
lines changed
libraries/SrcWrapper/src/stm32
3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 52
52
#undef HAL_SAI_MODULE_ENABLED
53
53
#endif
54
54
55
-
56
55
#if !defined(HAL_SPI_MODULE_DISABLED )
57
56
#define HAL_SPI_MODULE_ENABLED
58
57
#else
71
70
#undef HAL_ICACHE_MODULE_ENABLED
72
71
#endif
73
72
73
+ #if !defined(HAL_CRC_MODULE_ENABLED )
74
+ #define HAL_CRC_MODULE_ENABLED
75
+ #else
76
+ #undef HAL_CRC_MODULE_ENABLED
77
+ #endif
78
+
74
79
/*
75
80
* Not defined by default
76
81
*/
127
132
HAL_CEC_MODULE_ENABLED
128
133
HAL_COMP_MODULE_ENABLED
129
134
HAL_CORDIC_MODULE_ENABLED
130
- HAL_CRC_MODULE_ENABLED
131
135
HAL_CRYP_MODULE_ENABLED
132
136
HAL_DCMI_MODULE_ENABLED
133
137
HAL_DFSDM_MODULE_ENABLED
Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ void configIPClock(void)
173
173
/* Enable SYSCFG clock, needed for example: Pin remap or Analog switch ... */
174
174
__HAL_RCC_SYSCFG_CLK_ENABLE ();
175
175
#endif
176
+
177
+ /* Enable CRC clock, needed for example: MotionFX Library ... */
178
+ #if defined(__HAL_RCC_CRC2_CLK_ENABLE )
179
+ __HAL_RCC_CRC2_CLK_ENABLE ();
180
+ #elif defined(__HAL_RCC_CRC_CLK_ENABLE )
181
+ __HAL_RCC_CRC_CLK_ENABLE ();
182
+ #endif
176
183
}
177
184
178
185
#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
24
+ #elif defined(CRC_BASE )
25
+ #define CRC_INSTANCE CRC
26
+ #else
27
+ #error "No CRC instance available"
28
+ #endif
29
+ CRC_HandleTypeDef hcrc = {.Instance = CRC_INSTANCE };
30
+
22
31
/**
23
32
* @brief This function performs the global init of the system (HAL, IOs...)
24
33
* @param None
@@ -53,6 +62,11 @@ void hw_config_init(void)
53
62
/* Configure the system clock */
54
63
SystemClock_Config ();
55
64
65
+ /* Initialize the CRC */
66
+ #if defined(CRC_INSTANCE )
67
+ HAL_CRC_Init (& hcrc );
68
+ #endif
69
+
56
70
#if defined (USBCON ) && defined(USBD_USE_CDC )
57
71
USBD_CDC_init ();
58
72
#endif
You can’t perform that action at this time.
0 commit comments