F_CPU/8 speed for SD card

pull/1/head
Ondřej Hruška 9 years ago
parent 91e227f314
commit 3d946abdfd
  1. 5
      lib/sd.c

@ -45,10 +45,13 @@ bool sd_init()
return false; // timeout
// f_cpu/8 speed (-> 2 MHz)
SPSR |= _BV(SPI2X);
SPCR &= 0xFC | _BV(SPR0);
// Set block size to 512 bytes (SD card default)
sd_command(SD_SET_BLOCKLEN, 512);
return true;
}

Loading…
Cancel
Save