zakkemble / nrf905-arduino Goto Github PK
View Code? Open in Web Editor NEWnRF905 Arduino Library
Home Page: https://blog.zakkemble.net/nrf905-avrarduino-librarydriver/
License: GNU General Public License v3.0
nRF905 Arduino Library
Home Page: https://blog.zakkemble.net/nrf905-avrarduino-librarydriver/
License: GNU General Public License v3.0
Hello,
When compiling any sketch on an Arduino Zero, this error message is returned.
Any help is appreciated.
Thanks.
Compilation error: cannot allocate an object of abstract type 'arduino::HardwareSPI'
C:\Users****\Documents\Arduino\libraries\nRF905_Radio_Library\src/nRF905.h:179:12: error: cannot declare parameter 'spi' to be of abstract type 'arduino::HardwareSPI'
SPIClass spi,
Heya - the old version of your device driver works with the ESP8266/ESP32 chips but this one does not compile due to the lacking implementation in the SPI classes of those chips - ref: esp8266/Arduino#1943 (comment)
So line 212,213 and 233:6 are affected, the attachInterrupt
function from line 225 is working fine so is there a chance to convert the usingInterrupt
code over?
Hi,
I wanted to use this library for a project of mine, but encountered some problems. On my laptop the library didn't work at all and on my PC it was fine (testing with the debug sketch, via platform.io). Turns out, the ESP framework had an update recently and my laptop was using this one while my PC used a very old one. I tried a few versions, and everything above version 5.0.0 causes the library to stop working.
After some research, I found the following issue: espressif/arduino-esp32#7556. Here a commit was references adding some functionality regarding thread safety for SPI on the ESP32: espressif/arduino-esp32@bdeef89
This commit adds a destructor for the SPI class, which is the root of the problem. This destructor is called instantly after running the library's begin() function, causing the SPI interface to stop working (took a bit of time to figure this one out).
Inspecting the code of this library, I noticed that the SPIClass object passed in the begin() function was not passed as reference, causing the object to be copied instead. This caused the copy to be destroyed after the begin functions ends (since it no longer has references), which in turn calls the new destructor. At this point, the library doesn't work anymore. If you run the debug sketch, it will say "All registers read as 0xFF or 0x00! Is the nRF905 connected correctly?".
The fix was pretty simple though. I modified this library slightly to pass the SPI instance via the constructor as reference, and now it works again as the destructor is no longer called :) I also added that the library starts the SPI class automatically when calling begin().
You can look at it here: https://github.com/Xanderr/nRF905-arduino. If you want, I can make a PR for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.