I'm unclear on something here. In the event the SPI does not receive data from its master, how does one know?
for example if I have this
unsigned char Spi_read( unsigned char data)
SPDR = data;
while(!(SPSR & (1<<SPIF)));
and I need to wait for a 1 from the master I might do
if (Spi_read(1, 0xff) == 1)
but that is only good if the master replied with a 1 or other data. If the master does not reply I get my one back (apparently since that was put in) or that is what I see. So I almost need a if no reply SPDR =0; or return 0;
EDIT: hmm, I guess I can look at the enable line?