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