1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 13:15:55 +02:00

tornado/fw/mmc.c (mmc_wait): add 1 ms delay to wait loop

MMC-SPI specifies a card delay of up to 100 ms, which is easier to match
with an explicit delay than with a loop count.
This commit is contained in:
Werner Almesberger 2012-12-05 11:34:31 -03:00
parent d2f569fbf2
commit 0703611bbd

View File

@ -19,6 +19,7 @@
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
#include "delay.h"
#include "mmc-hw.h" #include "mmc-hw.h"
#include "mmc.h" #include "mmc.h"
@ -84,6 +85,7 @@ static bool mmc_wait(void)
v = mmc_recv(); v = mmc_recv();
if (v == MMC_START_SINGLE_BLOCK) if (v == MMC_START_SINGLE_BLOCK)
return 1; return 1;
_delay_ms(1);
} }
while (--tries); while (--tries);
return 0; return 0;