-
Notifications
You must be signed in to change notification settings - Fork 7.6k
SPI.transfer(buffer, size)
definition incompatible with other cores
#5787
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
Comments
how about you |
i can change the library - the buffer is used as uint16_t type - so this does not make much sens to change.
in the library. my main request was to fine tune for an cross-core-compatible API |
@s-light Do not use the core implementations as reference because they may have different implementations. Better use the official ArduinoCore-API repository https://github.com/arduino/ArduinoCore-API . The reference API has the So I agree that there should be a change or pass through to have better interoperability. |
@Rotzbua thanks for the pointer to the core api. so the best way would be
should i create a pullrequest with this change? |
I agree, this is just incompatible to arduino, which uses void* |
Hello @s-light, is this issue still valid? |
i will look at it and recheck... |
@s-light @VojtechBartoska I checked. The issue is still valid. |
challenge
i try to use the ulrichstern/Tlc59711 LED-Driver library to use with an ESP32 Dev Module.
this currently results in this compilation error:
after some research i found that in the ESP32 core the definition of
SPI.transfer(buffer, size)
differs to other cores.Minimal Example
with this the error can be reproduces if the board is a ESP32 Dev Kit
with AVR or SAMD it is compiling fine.
down the rabbit hole
currently the definition is:
libraries/SPI/src/SPI.h#70
libraries/SPI/src/SPI.cpp#229
this was added in #2136.
in the avr core its defined as
and in the samd core as
solution
so to be cross-platform compatible it is needed to change the parameters to the same types -
void *data, size_t count
i don't know yet what is need to get the called
transferBytes
function to work with this.i tested with this implementation:
its inspired by the other implementations - and it seems to work.
but i am not 100% sure if there are other side effects - so please review!
Hardware
Board: ESP32 Dev Module
Core Installation version: 2.0.0
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 921600
Computer OS: Kubuntu 20.04
The text was updated successfully, but these errors were encountered: