File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
libraries/mbed/targets/hal/TARGET_Freescale Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ void spi_frequency(spi_t *obj, int hz) {
115
115
uint8_t ref_prescaler = 0 ;
116
116
117
117
// bus clk
118
- uint32_t PCLK = 23986176u ;
118
+ uint32_t PCLK = SystemCoreClock / ((( SIM -> CLKDIV1 & SIM_CLKDIV1_OUTDIV4_MASK ) >> SIM_CLKDIV1_OUTDIV4_SHIFT ) + 1 ) ;
119
119
uint8_t prescaler = 1 ;
120
120
uint8_t divisor = 2 ;
121
121
Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ void spi_frequency(spi_t *obj, int hz) {
158
158
uint8_t ref_prescaler = 0 ;
159
159
160
160
// bus clk
161
- uint32_t PCLK = 48000000u ;
161
+ uint32_t PCLK = SystemCoreClock / ((( SIM -> CLKDIV1 & SIM_CLKDIV1_OUTDIV4_MASK ) >> SIM_CLKDIV1_OUTDIV4_SHIFT ) + 1 ) ;
162
162
uint8_t prescaler = 1 ;
163
163
uint8_t divisor = 2 ;
164
164
You can’t perform that action at this time.
0 commit comments