Fix unused pin PB0 being used in init

This pin is unused and shouldn't be set by the library.
This commit is contained in:
Jack Massey 2019-03-14 11:32:31 +10:00
parent e35c9ae2e5
commit 8fecfbff00
1 changed files with 2 additions and 2 deletions

4
spi.c
View File

@ -2,10 +2,10 @@
void spi_init(void) {
// Set MOSI and SCK, SS/CS output, all others input
DDRB = (1<<PB3) | (1<<PB5) | (1<<PB2) | (1<<PB0);
DDRB = (1<<PB3) | (1<<PB5) | (1<<PB2);
// Enable SPI, Master, set clock rate fck/4, mode 0
SPCR = (1<<SPE) | (1<<MSTR);
// Set SS/CS
PORTB |= (1 << PB2) | (1 << PB0);
PORTB |= (1 << PB2);
}