diff options
author | Keith Packard <keithp@keithp.com> | 2013-01-13 10:31:59 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-01-13 10:32:52 -0800 |
commit | 3645cb6578ec2a11ab7b0f6d435c6de22ca02a9f (patch) | |
tree | ab5a2b94e36a2a67b1c8321d7f2e0ad40ae70076 /src/avr | |
parent | 7883744526156879ad63256ab12d959df56d5252 (diff) |
Update avr ao_spi_slave code to match API changes
Made the interface use void * for pointers and uint16_t for lengths
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/avr')
-rw-r--r-- | src/avr/ao_spi_slave.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/avr/ao_spi_slave.c b/src/avr/ao_spi_slave.c index a400b8a0..15e9924d 100644 --- a/src/avr/ao_spi_slave.c +++ b/src/avr/ao_spi_slave.c @@ -18,22 +18,24 @@ #include "ao.h" uint8_t -ao_spi_slave_recv(uint8_t *buf, uint8_t len) +ao_spi_slave_recv(void *buf, uint16_t len) { + uint8_t *b = buf; while (len--) { while (!(SPSR & (1 << SPIF))) if ((PINB & (1 << PINB0))) return 0; - *buf++ = SPDR; + *b++ = SPDR; } return 1; } void -ao_spi_slave_send(uint8_t *buf, uint8_t len) +ao_spi_slave_send(void *buf, uint16_t len) { + uint8_t *b = buf; while (len--) { - SPDR = *buf++; + SPDR = *b++; while (!(SPSR & (1 << SPIF))) if ((PINB & (1 << PINB0))) return; |