File tree 3 files changed +18
-15
lines changed
libraries/SrcWrapper/src/stm32
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);
62
62
uint32_t getCurrentMicros (void );
63
63
64
64
void enableClock (sourceClock_t source );
65
+ void configHSECapacitorTuning (void );
66
+
65
67
#ifdef __cplusplus
66
68
}
67
69
#endif
Original file line number Diff line number Diff line change 37
37
*/
38
38
#include "backup.h"
39
39
#include "clock.h"
40
+ #include "otp.h"
40
41
#include "stm32yyxx_ll_cortex.h"
42
+ #include "stm32yyxx_ll_rcc.h"
41
43
42
44
#ifdef __cplusplus
43
45
extern "C" {
@@ -160,6 +162,18 @@ void enableClock(sourceClock_t source)
160
162
}
161
163
}
162
164
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
+
163
177
#ifdef __cplusplus
164
178
}
165
179
#endif
Original file line number Diff line number Diff line change 17
17
*/
18
18
19
19
#include " pins_arduino.h"
20
- #include " otp .h"
20
+ #include " clock .h"
21
21
22
22
#ifdef __cplusplus
23
23
extern " C" {
@@ -89,19 +89,6 @@ const PinName digitalPin[] = {
89
89
extern " C" {
90
90
#endif
91
91
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
-
105
92
/* *
106
93
* @brief System Clock Configuration
107
94
* @param None
@@ -113,7 +100,7 @@ WEAK void SystemClock_Config(void)
113
100
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
114
101
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {};
115
102
116
- Config_HSE ();
103
+ configHSECapacitorTuning ();
117
104
118
105
__HAL_RCC_LSEDRIVE_CONFIG (RCC_LSEDRIVE_LOW);
119
106
__HAL_PWR_VOLTAGESCALING_CONFIG (PWR_REGULATOR_VOLTAGE_SCALE1);
You can’t perform that action at this time.
0 commit comments