From: Keith Packard Date: Sat, 7 Apr 2012 05:40:49 +0000 (-0700) Subject: altos: Shuffle stm-demo SPI test code around a bit X-Git-Tag: 1.0.9.5~85 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2db6b0f58811ffc44a468c8fbcacc08d37edd26c altos: Shuffle stm-demo SPI test code around a bit Move a debug printf beyond the chip select boundary to allow for more accurate timing. Send four bytes instead of just one. Signed-off-by: Keith Packard --- diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c index 54f7c8f2..5ff2b32a 100644 --- a/src/stm-demo/ao_demo.c +++ b/src/stm-demo/ao_demo.c @@ -82,7 +82,7 @@ ao_spi_write(void) { for (i = 0; i < 10; i++) { ao_spi_get(0); stm_gpio_set(&stm_gpioc, 12, 0); - ao_spi_send(data, 1, 0); + ao_spi_send(data, 4, 0); stm_gpio_set(&stm_gpioc, 12, 1); ao_spi_put(0); printf("."); @@ -100,10 +100,10 @@ ao_spi_read(void) { ao_spi_get(0); stm_gpio_set(&stm_gpioc, 12, 0); ao_spi_recv(data, 4, 0); - printf("."); - flush(); stm_gpio_set(&stm_gpioc, 12, 1); ao_spi_put(0); + printf("."); + flush(); ao_delay(100); } }