adafruit / Adafruit_WICED_Arduino

Adafruit WICED Feather Arduino BSP
https://www.adafruit.com/products/3056
27 stars 19 forks source link

Fix SPIClass Has Not Been Defined Compilation Errors #86

Closed bluebinary closed 4 years ago

bluebinary commented 4 years ago

Fixes an issue related to the SPI class name, which prevents the compilation of user code targeted to the Feather WICED board that requires SPI support via SPIClass.

Within the WICED library, the SPI class is named as HardwareSPI in cores/maple/libmaple/SPI.h, in contrast to the Arduino Core, which defines the class as SPIClass. It is the latter that is most often referenced by other libraries and in user code.

By providing a mapping between the HardwareSPI and SPIClass names via a #define, any 'SPIClass' has not been declared compilation errors should be resolved (testing has shown as much). Furthermore, by specifying the #define within cores/maple/libmaple/SPI.h, it should not be necessary to add additional SPIClass aliasing #defines elsewhere.

bluebinary commented 4 years ago

Please see this Adafruit forum post for the inspiration for this fix: https://forums.adafruit.com/viewtopic.php?f=24&t=161264, and credit must go to adafruit_support_mike (thank you!) who noted in the forum post back in January that a #define SPIClass HardwareSPI added into any affected code should resolve the SPI class naming issue.