madhephaestus / ESP32Servo

Arduino-compatible servo library for the ESP32
139 stars 55 forks source link

Update for Arduino ESP32 V3.0.0 with the new changes for the ADC Library #45

Closed Goober56 closed 5 months ago

Goober56 commented 9 months ago

Successfully got it to work with a servo. Compiles and uploads to a base ESP32-WROOM-32 Dev Board

brentru commented 9 months ago

@madhephaestus @Goober56 While this works perfectly with ESP32 BSP 3.x and you should merge a fix like this, I think you may want to retain some backward compatibility with the older ADC API (pre-ESP 32 BSP3.x).

If you need help with this, or want me to tackle this portion instead, let me know

Goober56 commented 9 months ago

@brentru Yeah that would be great! I am a mere beginner in this space and have no idea how to create something like that. I wanted to move this library over to V3 because the ESP32 C6 I am using only works on the V3. All my projects involve servos as well.

Thank you for wanting to implementing something like that to this. It wasn't my intention to completely take away the previous version. I just wanted to show others like me that there is a fork of the library that works with the new BSP. But if we can get them both into one library that would be amazing!

madhephaestus commented 7 months ago

Wow, this is awsome! its good to have an option for folks that are looking for a fast solution. Officially it would be better to wrap each change in a compiler gaurd to maintain at least the 2.x variant in backwards compatibility. Or i guess we can wait for 3.x to be out of testing and made the official release, in which case we can just merge this PR and say for older toolchains (i know i have a few projects that got broken by the 3.x so i keep them at 2.x) they can just pin to an older release.

brentru commented 7 months ago

@madhephaestus Espressif recently published official documentation about this topic, https://github.com/espressif/arduino-esp32/blob/master/docs/en/guides/core_compatibility.rst. You may want to copy their inclusion checks and version guards from the "Code Adaptations" section of the documentation.

madhephaestus commented 7 months ago

@madhephaestus Espressif recently published official documentation about this topic, https://github.com/espressif/arduino-esp32/blob/master/docs/en/guides/core_compatibility.rst. You may want to copy their inclusion checks and version guards from the "Code Adaptations" section of the documentation.

I think @Goober56 has taken the lead on this feature, so it would be bad form for me to come in and change all the lines they changed in this PR, taking effective git repo history credit for this update. I would prefer for the credit, and therefor the change responsibility, to stay with the lead developer of this feature, @Goober56

That said, i do agree that the changes do need to be made, and its great espressif provides working examples of how to set up guards for cross compilation.

Goober56 commented 7 months ago

@madhephaestus Espressif recently published official documentation about this topic, https://github.com/espressif/arduino-esp32/blob/master/docs/en/guides/core_compatibility.rst. You may want to copy their inclusion checks and version guards from the "Code Adaptations" section of the documentation.

I think @Goober56 has taken the lead on this feature, so it would be bad form for me to come in and change all the lines they changed in this PR, taking effective git repo history credit for this update. I would prefer for the credit, and therefor the change responsibility, to stay with the lead developer of this feature, @Goober56

That said, i do agree that the changes do need to be made, and its great espressif provides working examples of how to set up guards for cross compilation.

I will start working on this when i get some time. Thank you so much for letting me know about this and how to go about it. Ill make sure to keep everyone updated when i manage to get it working. This is my first time doing this so i appreciate the wait and assistance <3

madhephaestus commented 5 months ago

For reference: As of 3.0.4 I have added the compiler gaurds to switch between the toolchain versions. In the IDE the default version is 3.0.1 but in the web editor the 2.0.17 is the maximum version. this library will now compile the latest version in either toolchain.