diff --git a/avrrfm.c b/avrrfm.c index d261db1..658bfb8 100644 --- a/avrrfm.c +++ b/avrrfm.c @@ -317,10 +317,7 @@ // used only for tx initWatchdog(); initTimer(); - // TODO with the radio breakout on the same SPI bus, - // first SD card init fails, second succeeds always sdcard = initSDCard(); - if (!sdcard) sdcard = initSDCard(); } // enable global interrupts diff --git a/sdcard.c b/sdcard.c index 9411336..f791d85 100644 --- a/sdcard.c +++ b/sdcard.c @@ -201,6 +201,11 @@ // CMD0 - go to idle state response[0] = sendIdle(); if (response[0] > 0x01) { + // retry solves failure possibly caused by another component + // on the same SPI bus + response[0] = sendIdle(); + } + if (response[0] > 0x01) { printString("SD card error 0\r\n"); return false; }