fixed clock switch
This commit is contained in:
parent
9bce46516a
commit
1844e46167
@ -214,12 +214,11 @@ void initModuleHw(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void switchPrescaler(uint8_t clkdiv) {
|
void switchPrescaler(uint8_t clkdiv) {
|
||||||
SDIO->POWER = 0;
|
uint32_t reg;
|
||||||
__DSB();
|
reg = SDIO->CLKCR;
|
||||||
SDIO->CLKCR &= ~SDIO_CLKCR_CLKDIV; // Clear prescaler
|
reg &= ~SDIO_CLKCR_CLKDIV; // Clear prescaler
|
||||||
SDIO->CLKCR |= (SDIO_CLKCR_CLKDIV & clkdiv); // Set bits
|
reg |= (SDIO_CLKCR_CLKDIV & clkdiv); // Set bits
|
||||||
__DSB();
|
SDIO->CLKCR = reg;
|
||||||
SDIO->POWER = SDIO_POWER_PWRCTRL_0 | SDIO_POWER_PWRCTRL_1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user