Fix compilation errors

Fixed an invalid bit read and added a missing semicolon.
This commit is contained in:
Marco Vitchi Thulin 2024-03-10 16:42:23 +01:00
parent 12f1ce3e78
commit 660dd4e8de

5
main.c
View file

@ -90,12 +90,13 @@ uint8_t SendReceiveSPIData(uint8_t value)
// prob change the 8 below to len of value?
for(i=0;i<8;i++)
{
USIDR=value[i]; // write data bytes in Data register, will cause them to get sent on clock
///USIDR = value[i]; // wrong way to do it apparently, still saving for future reference
USIDR = (value >> i) & 0x01; // write data bytes in Data register, will cause them to get sent on clock
while(USIOIF==0) // check USI data counter overflow flag to detect the end of transmission every byte
{
USICR|=(1<<USICLK)|(1<<USITC); // enable clock for transmission and generate clock for slave deivce
}
USISR|=(1<<USIOIF) // clear USI data counter overflow flag
USISR|=(1<<USIOIF); // clear USI data counter overflow flag
}
// Read in a 16 bit frame