File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
libraries/SrcWrapper/src/stm32 Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 5252 #undef HAL_SAI_MODULE_ENABLED
5353#endif
5454
55-
5655#if !defined(HAL_SPI_MODULE_DISABLED )
5756 #define HAL_SPI_MODULE_ENABLED
5857#else
7170 #undef HAL_ICACHE_MODULE_ENABLED
7271#endif
7372
73+ #if !defined(HAL_CRC_MODULE_ENABLED )
74+ #define HAL_CRC_MODULE_ENABLED
75+ #else
76+ #undef HAL_CRC_MODULE_ENABLED
77+ #endif
78+
7479/*
7580 * Not defined by default
7681 */
127132 HAL_CEC_MODULE_ENABLED
128133 HAL_COMP_MODULE_ENABLED
129134 HAL_CORDIC_MODULE_ENABLED
130- HAL_CRC_MODULE_ENABLED
131135 HAL_CRYP_MODULE_ENABLED
132136 HAL_DCMI_MODULE_ENABLED
133137 HAL_DFSDM_MODULE_ENABLED
Original file line number Diff line number Diff line change @@ -173,6 +173,13 @@ void configIPClock(void)
173173 /* Enable SYSCFG clock, needed for example: Pin remap or Analog switch ... */
174174 __HAL_RCC_SYSCFG_CLK_ENABLE ();
175175#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
176183}
177184
178185#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
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+
2231/**
2332 * @brief This function performs the global init of the system (HAL, IOs...)
2433 * @param None
@@ -53,6 +62,11 @@ void hw_config_init(void)
5362 /* Configure the system clock */
5463 SystemClock_Config ();
5564
65+ /* Initialize the CRC */
66+ #if defined(CRC_INSTANCE )
67+ HAL_CRC_Init (& hcrc );
68+ #endif
69+
5670#if defined (USBCON ) && defined(USBD_USE_CDC )
5771 USBD_CDC_init ();
5872#endif
You can’t perform that action at this time.
0 commit comments