From 2db6b0f58811ffc44a468c8fbcacc08d37edd26c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 6 Apr 2012 22:40:49 -0700 Subject: [PATCH] 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 --- src/stm-demo/ao_demo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); } } -- 2.30.2