diff options
| author | Keith Packard <keithp@keithp.com> | 2012-04-06 22:40:49 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-04-06 22:40:49 -0700 | 
| commit | 2db6b0f58811ffc44a468c8fbcacc08d37edd26c (patch) | |
| tree | 575c46c8c4fa03eb0f56b662d0d9c874c0b4939f | |
| parent | 89201cdf2062b7319a0da4e266e4d6edba1493f8 (diff) | |
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 <keithp@keithp.com>
| -rw-r--r-- | src/stm-demo/ao_demo.c | 6 | 
1 files 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);  	}  } | 
