adafruit / Adafruit_FRAM_SPI

Driver for Adafruit's SPI-Based FRAM Breakouts
Other
34 stars 30 forks source link

Compilation error on SAMD51 boards related to SPI clock divider #8

Closed XFactHD closed 5 years ago

XFactHD commented 5 years ago
#include <Adafruit_FRAM_SPI.h>
void setup() {}
void loop() {}

Compiling these three lines for any SAMD51 based board from Adafruit causes a compilation error in the begin() function on line 97 where the clock divider is set. Looking at the error

Adafruit_FRAM_SPI.cpp:97:23: error: SPI_CLOCK_DIV2 was not declared in this scope
SPI.setClockDivider (SPI_CLOCK_DIV2); // 8 MHz

leads me to believe that the SAMD51 boards are completely missing the SPI clock divider defines.

If you would prefer to handle this issue over on your Arduino_SAMD repo, I will move it there.

ladyada commented 5 years ago

oh yeah this is ancient, and should be redone to use SPI transactions. would you be interested in replacing the current code to use transactions and submitting a PR?

XFactHD commented 5 years ago

Sure, I'll take a look and submit a PR when I get it working.

ladyada commented 5 years ago

sweet, thanks!

XFactHD commented 5 years ago

I have opened a PR with the requested changes.

ladyada commented 5 years ago

resolved!