-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Why is SPI included in this lib? #572
Comments
I didn't write the initial support for ATTiny so I don't know exactly, but I suspect SPI didn't properly exist in ATTiny board cores. If there's a way now to detect ATTinycore that has proper SPI then a preprocessor directive can probably be added. Pull requests are welcome. |
Maybe something like this? (This works but is pretty nasty.)
|
@jscrane Maybe ATTinyCore people could be nicely asked to define a version number somewhere, then RF24 could check for that? |
Lets admit, its kind of nasty. lol Being the party responsible for adding the SPI code in for ATTiny, (stolen from @jscrane ) if I remember... I felt the need to chime in here. Anyway, I think its about time we just removed ATTiny SPI support from RF24 altogether. It was added in prior because there was not much for alternatives. Now that the ATTiny core has it included, I don't see any reason why we should maintain SPI support for ATTiny SPI here, probably just adds more confusion than anything. So, if this seems like a good idea and anybody gets a chance, I think the changes required are pretty straightforward, mostly just delete a bunch of stuff from RF24, and test with the examples etc to ensure functionality. I probably won't have a chance to do it for a while. |
I totally forgot about this issue. (because my ATTiny runs without any problem on a battery using SPI for 6+ months now). Now, what I did to make my ATTiny code to compile was to comment out the I've only looked to ATTiny85. |
I added this to the Hacktoberfest list of potential contributions. The only thing expected is that someone removes the ATTiny-specific SPI workarounds from the library and tests on a physical device that it works with ATTiny core on at least two ATTiny's. If someone has any other ideas, requirements or suggestions to this request, leave them below. |
I have been putting off wiring up 3V regulators, but I have a digispark board (ATTiny85) that I can test changes on. I'm assuming the 3-wire hack wouldn't be affected. |
I have some Tinysensors with ATtiny84 I can test on too if that helps... |
Why is there a "custom" SPI class included in this lib?
I'm using this lib on an ATtiny85 and in the Arduino framework (https://github.com/SpenceKonde/ATTinyCore) there is a lib available. Furthermore, when using other libraries that use SPI (like a BME280), there's no other way to adapt this library and use the framework's lib. Otherwise you get redefinition errors.
The text was updated successfully, but these errors were encountered: