Changes to remove dependancy on Arduino, for ESPIDF and Pico among others.#66
Changes to remove dependancy on Arduino, for ESPIDF and Pico among others.#66mwinters-stuff wants to merge 5 commits intoDCC-EX:mainfrom
Conversation
peteGSX
left a comment
There was a problem hiding this comment.
What is the driver for making these changes? These will be significant breaking changes for existing library uses, and in the recent version, we explicitly moved away from cmake based tests to PlatformIO tests. I'd also much prefer not to include any IDE specific files. This needs to maintain compatibility with both the Arduino IDE and PlatformIO, have you tested with those?
|
My driver was originally to use a RPI Pico2-W which was not well supported in platformio, So i initially made the change for using the Pico CPP SDK, without arduino. Finding that was not sufficient I "upgraded" to a ESP32S3, with a graphic screen. This too I wanted to use the base sdk, that is the ESP-IDF, so was able to use it there. This is one of the libraries where Arduino is not necessary and only used for "millis()" and the "Stream" interface/class. Both of these were easy to replace. I did originally add "millis()" into the delegate, but that was not super useful with your upgraded tests. I did run the tests both in platformio and via cmake (which integrates better for running/debugging individual tests in vscode). I also ran all the examples after making the changes (all of which are the same) on platformio. The code there is basically exactly what someone using Arduino.h would need. I prefer to be able to easily debug my code - platformio / arduino is not so easy to setup. You can look at my current development - mostly been working on the connectivity and basic screens at |
|
While we're not against making changes to support more than just the Arduino framework, we're not keen on accepting this PR exactly as it is given it's a breaking change. If you were able to add some #ifdef statements or similar so that existing users see no difference while adding support for the other platforms we'd be happy to review and do some testing. |
|
I should also add feel free to join us in Discord and talk directly on the topic also, which might be easier than going back and forth in GitHub comments. The invite link is here: https://discord.gg/y2sB4Fp |
I didnt want to write Arduino code for my controller, so I looked and saw the only reason for Arduino.h includes were for
millis()and the built-inStreamclass.This was easy to resolve.
I have
DCCExControllerto keep the code seperate.DCCStream, and this is passed in place ofStream.DCCMillisinterface, an simple implementation is passed toDCCEXProtocolIf Null is passed this will freeze the program.DCCMillisandDCCStream