-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix MegaCoreX library to support ArduinoModBus and ArduinoRS485 #198
Conversation
Sorry for being so slow to adopt. Thanks the PR! |
Turns out that this PR broke support for the ethernet library. How can this be resolved? #include <Ethernet.h>
void setup() {
}
void loop() {
}
|
Huh... that is really strange... the EthernetClass is marked as a friend so raw_address should be accessible... let me see if another synchronization is necessary... |
Yeah... this is my fault since I made the minimal number of changes necessary to get ArudinoModBus to compile. The friend statement is different on the ArduinoCore-API's version: https://github.com/arduino/ArduinoCore-API/blob/4a02bfc0a924e1fec34c3bb82ffd5dfba7643a0c/api/IPAddress.h#L107 |
This is a fix for #192 .
Arduino's modbus library is written assuming that the ArduinoCore-API is new enough that there is an arduino namespace. The version inside MegaCoreX is an older version of the api and does not have this. This pull request adds the minimal number of classes in the api to the arduino namespace to allow ArduinoModbus to compile.
The second change is related, the ArduinoRS485 library is written with the assumption that the macro SERIAL_PORT_HARDWARE is available from the board's variant header. This assumption was violated for the standard 28/32/40/48 pin variants. This pull request introduces these missing macros for libraries such as ArduinoRS485 so that they can compile successfully. I tried using what I viewed as sane defaults.