altos: Retry SD card I/O. Use time for timeouts instead of counts
authorKeith Packard <keithp@keithp.com>
Mon, 1 Apr 2013 09:08:18 +0000 (02:08 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 1 Apr 2013 09:08:18 +0000 (02:08 -0700)
commitb34370cea662eb245e43aca20a6650b84b55ef6f
tree7066f6a98b4e9a81549c04605c31cc52cd4854a1
parentb3a41bed39ec1abfc3ab74e9be7dd393e975542b
altos: Retry SD card I/O. Use time for timeouts instead of counts

Sometimes I/O operations may fail; give the card a chance and retry
the operation in case it works the next time.

Replace the loop counts with loops that check the clock so that
they'll have consistent timeouts even if the CPU or SPI speed changes.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_sdcard.c
src/drivers/ao_sdcard.h