diff --git a/libubb/mmcclk.c b/libubb/mmcclk.c index 77c955e..856ed24 100644 --- a/libubb/mmcclk.c +++ b/libubb/mmcclk.c @@ -70,15 +70,16 @@ void mmcclk_start(struct mmcclk *dsc) MSCCDR = dsc->clkdiv; /* set controller clock */ CLKGR &= ~(1 << 7); /* enable MSC clock */ - MSC_STRPCL = 1 << 3; /* reset the MSC */ - while (MSC_STAT & (1 << 15)); /* wait until reset finishes */ + MSC_STRPCL = MSC_STRPCRL_RESET; /* reset the MSC */ + while (MSC_STAT & MSC_STAT_IS_RESETTING); + /* wait until reset finishes */ MSC_CLKRT = dsc->clkrt; /* set bus clock */ - MSC_STRPCL = 2; /* start MMC bus clock output */ + MSC_STRPCL = MSC_STRPCRL_START_CLOCK; } void mmcclk_stop(void) { - MSC_STRPCL = 1; /* stop MMC bus clock output */ + MSC_STRPCL = MSC_STRPCRL_STOP_CLOCK; }