summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-10-14 18:50:45 -0700
committerKeith Packard <keithp@keithp.com>2012-10-14 18:50:45 -0700
commitb7b310e0ff26444e441f82d9a5c0c64a5c71508e (patch)
treefca9ec0b0279ebd7b43104b031daee995045d4c0
parent91b8c8b20cead2836ec835f44b4ca0cf06cbf518 (diff)
altos: Wait for companion to see CS before attempting communcationcompanion-delay
The AVR just can't go fast enough to see the CS in time, so pause for a while. (rewritten from f9607fb76c22187396cceb46b745fa1485d4f155) Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/drivers/ao_companion.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/drivers/ao_companion.c b/src/drivers/ao_companion.c
index c749adea..2ed407f1 100644
--- a/src/drivers/ao_companion.c
+++ b/src/drivers/ao_companion.c
@@ -24,11 +24,14 @@
#endif
#define COMPANION_SELECT() do { \
+ uint8_t pause; \
ao_spi_get_bit(AO_COMPANION_CS_PORT, \
AO_COMPANION_CS_PIN, \
AO_COMPANION_CS, \
AO_COMPANION_SPI_BUS, \
AO_SPI_SPEED_200kHz); \
+ for (pause = 0; pause < 100; pause++) \
+ ao_arch_nop(); \
} while (0)
#define COMPANION_DESELECT() do { \