aboutsummaryrefslogtreecommitdiff
path: root/src/spi.c
blob: d7af29715aee63216c2cc87f86774616872efebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <spi.h>

#ifdef CONFIG_SPI

volatile int8_t _spi_busy;

void (*spi_receive) (uint8_t data) = 0;

ISR(SPI_STC_vect, ISR_BLOCK) {
	_spi_busy = 0;
	if (spi_receive != 0) {
		spi_receive(SPDR);
	}
}

#endif /* CONFIG_SPI */