File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ static void setup_nvic(void) {
120
120
namespace wirish {
121
121
namespace priv {
122
122
123
+ __weak rcc_clk w_board_pll_in_clk = RCC_CLK_HSE;
124
+
123
125
__weak void board_setup_flash (void ) {
124
126
// Turn on as many Flash "go faster" features as
125
127
// possible. flash_enable_features() just ignores any flags it
@@ -140,15 +142,17 @@ __weak void board_setup_clocks(void) {
140
142
RCC_BASE->CFGR = 0x00000000 ;
141
143
rcc_disable_css ();
142
144
rcc_turn_off_clk (RCC_CLK_PLL);
143
- rcc_turn_off_clk (RCC_CLK_HSE);
145
+ if (w_board_pll_in_clk != RCC_CLK_HSI) {
146
+ rcc_turn_off_clk (w_board_pll_in_clk);
147
+ }
144
148
wirish::priv::board_reset_pll ();
145
149
// Clear clock readiness interrupt flags and turn off clock
146
150
// readiness interrupts.
147
151
RCC_BASE->CIR = 0x00000000 ;
148
152
149
- // Enable HSE , and wait until it's ready.
150
- rcc_turn_on_clk (RCC_CLK_HSE );
151
- while (!rcc_is_clk_ready (RCC_CLK_HSE ))
153
+ // Enable the PLL input clock , and wait until it's ready.
154
+ rcc_turn_on_clk (w_board_pll_in_clk );
155
+ while (!rcc_is_clk_ready (w_board_pll_in_clk ))
152
156
;
153
157
154
158
// Configure AHBx, APBx, etc. prescalers and the main PLL.
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ namespace wirish {
52
52
*/
53
53
54
54
extern rcc_pll_cfg w_board_pll_cfg;
55
+ extern rcc_clk w_board_pll_in_clk;
55
56
extern adc_prescaler w_adc_pre;
56
57
extern adc_smp_rate w_adc_smp;
57
58
You can’t perform that action at this time.
0 commit comments