Skip to content

Commit b693420

Browse files
committed
Add support to CRC peripheral by default
1 parent 437cbed commit b693420

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

cores/arduino/stm32/stm32yyxx_hal_conf.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
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
@@ -71,6 +70,12 @@
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
*/
@@ -127,7 +132,6 @@
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

libraries/SrcWrapper/src/stm32/clock.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ 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+
#if defined(__HAL_RCC_CRC_CLK_ENABLE)
178+
/* Enable CRC clock, needed for example: MotionFX Library ... */
179+
__HAL_RCC_CRC_CLK_ENABLE();
180+
#endif
176181
}
177182

178183
#ifdef __cplusplus

libraries/SrcWrapper/src/stm32/hw_config.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
extern "C" {
2020
#endif
2121

22+
CRC_HandleTypeDef hcrc = {.Instance = CRC};
23+
2224
/**
2325
* @brief This function performs the global init of the system (HAL, IOs...)
2426
* @param None
@@ -53,6 +55,9 @@ void hw_config_init(void)
5355
/* Configure the system clock */
5456
SystemClock_Config();
5557

58+
/* Initialize the CRC */
59+
HAL_CRC_Init(&hcrc);
60+
5661
#if defined (USBCON) && defined(USBD_USE_CDC)
5762
USBD_CDC_init();
5863
#endif

0 commit comments

Comments
 (0)