watterott / ATmega328PB-Testing

Atmel/Microchip ATmega328PB support for Arduino IDE
https://learn.watterott.com
76 stars 61 forks source link

SPCR, SPDR, and SPSR are not declared in the scope #36

Closed jvinsko closed 6 years ago

jvinsko commented 6 years ago

I am currently developing on a custom board using the ATmega328pb. I was successfully able to put the bootloader on it and now I can program to the board using the USB I put on the board.

However, when I try to upload the code that I designed the board for, I get a slew of errors involving the inability to write or read from the SPI registers SPCR, SPDR, and SPSR, saying they were "not declared in this scope". I have tried grabbing the exact SPI library from this repository and putting it into my sketchbook, and the Arduino IDE (version 1.8.5) told me that it was correctly using this library.

I am running Arduino IDE 1.8.5, Arduino AVR Boards is updated to version 1.6.207, and I am able to reach the board and program to it.

jvinsko commented 6 years ago

Of course as soon as I type this up, I figured it out.

Including SPI.h in my main script did not translate into the other libraries I was using, and I was able to include SPI.h in that library instead, solving my issue.