liblitesdcard/sdcard: use max divider of 256 (128 was not enough for the initial 400Khz clock frequency).
This commit is contained in:
parent
8f92034ddd
commit
8bdf6941a3
|
@ -132,7 +132,7 @@ static void sdcard_set_clk_freq(uint32_t clk_freq) {
|
||||||
divider = CONFIG_CLOCK_FREQUENCY/clk_freq + 1;
|
divider = CONFIG_CLOCK_FREQUENCY/clk_freq + 1;
|
||||||
divider = (1 << log2(divider));
|
divider = (1 << log2(divider));
|
||||||
divider = max(divider, 2);
|
divider = max(divider, 2);
|
||||||
divider = min(divider, 128);
|
divider = min(divider, 256);
|
||||||
#ifdef SDCARD_DEBUG
|
#ifdef SDCARD_DEBUG
|
||||||
printf("Setting SDCard clk freq to ");
|
printf("Setting SDCard clk freq to ");
|
||||||
if (clk_freq > 1000000)
|
if (clk_freq > 1000000)
|
||||||
|
|
Loading…
Reference in New Issue