File tree Expand file tree Collapse file tree 3 files changed +18
-15
lines changed
libraries/SrcWrapper/src/stm32 Expand file tree Collapse file tree 3 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ uint32_t getCurrentMillis(void);
6262uint32_t getCurrentMicros (void );
6363
6464void enableClock (sourceClock_t source );
65+ void configHSECapacitorTuning (void );
66+
6567#ifdef __cplusplus
6668}
6769#endif
Original file line number Diff line number Diff line change 3737 */
3838#include "backup.h"
3939#include "clock.h"
40+ #include "otp.h"
4041#include "stm32yyxx_ll_cortex.h"
42+ #include "stm32yyxx_ll_rcc.h"
4143
4244#ifdef __cplusplus
4345extern "C" {
@@ -160,6 +162,18 @@ void enableClock(sourceClock_t source)
160162 }
161163}
162164
165+ void configHSECapacitorTuning (void )
166+ {
167+ #if defined(OTP_AREA_BASE ) && defined(STM32WBxx )
168+ OTP_BT_t * p_otp ;
169+ /* Read HSE_Tuning from OTP with index 0 */
170+ p_otp = (OTP_BT_t * ) OTP_Read (0 );
171+ if (p_otp ) {
172+ LL_RCC_HSE_SetCapacitorTuning (p_otp -> hse_tuning );
173+ }
174+ #endif
175+ }
176+
163177#ifdef __cplusplus
164178}
165179#endif
Original file line number Diff line number Diff line change 1717*/
1818
1919#include " pins_arduino.h"
20- #include " otp .h"
20+ #include " clock .h"
2121
2222#ifdef __cplusplus
2323extern " C" {
@@ -89,19 +89,6 @@ const PinName digitalPin[] = {
8989extern " C" {
9090#endif
9191
92- static void Config_HSE (void )
93- {
94- OTP_BT_t *p_otp;
95-
96- /* *
97- * Read HSE_Tuning from OTP
98- */
99- p_otp = (OTP_BT_t *) OTP_Read (0 );
100- if (p_otp) {
101- LL_RCC_HSE_SetCapacitorTuning (p_otp->hse_tuning );
102- }
103- }
104-
10592/* *
10693 * @brief System Clock Configuration
10794 * @param None
@@ -113,7 +100,7 @@ WEAK void SystemClock_Config(void)
113100 RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
114101 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
115102
116- Config_HSE ();
103+ configHSECapacitorTuning ();
117104
118105 __HAL_RCC_LSEDRIVE_CONFIG (RCC_LSEDRIVE_LOW);
119106 __HAL_PWR_VOLTAGESCALING_CONFIG (PWR_REGULATOR_VOLTAGE_SCALE1);
You can’t perform that action at this time.
0 commit comments