projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Provide timeout value to ao_radio_recv
[fw/altos]
/
src
/
avr
/
ao_spi_slave.c
diff --git
a/src/avr/ao_spi_slave.c
b/src/avr/ao_spi_slave.c
index a400b8a0a929f0485b8d8da894f43c17ec098f79..15e9924da5d6f20c4b1b454a3393d3fea9d23c31 100644
(file)
--- a/
src/avr/ao_spi_slave.c
+++ b/
src/avr/ao_spi_slave.c
@@
-18,22
+18,24
@@
#include "ao.h"
uint8_t
#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;
while (len--) {
while (!(SPSR & (1 << SPIF)))
if ((PINB & (1 << PINB0)))
return 0;
- *b
uf
++ = SPDR;
+ *b++ = SPDR;
}
return 1;
}
void
}
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--) {
while (len--) {
- SPDR = *b
uf
++;
+ SPDR = *b++;
while (!(SPSR & (1 << SPIF)))
if ((PINB & (1 << PINB0)))
return;
while (!(SPSR & (1 << SPIF)))
if ((PINB & (1 << PINB0)))
return;