#include "ao.h"
uint8_t
-ao_spi_read(uint8_t *buf, uint8_t len)
+ao_spi_slave_recv(uint8_t *buf, uint8_t len)
{
while (len--) {
while (!(SPSR & (1 << SPIF)))
}
void
-ao_spi_write(uint8_t *buf, uint8_t len)
+ao_spi_slave_send(uint8_t *buf, uint8_t len)
{
while (len--) {
SPDR = *buf++;
static uint8_t ao_spi_slave_running;
-ISR(PCINT0_vect)
+ISR(PCINT0_vect, ISR_BLOCK)
{
- cli();
#if SPI_SLAVE_PIN_0_3
if ((PINB & (1 << PORTB0)) == 0)
#endif
} else {
ao_spi_slave_running = 0;
}
- sei();
}
void