Adapt library for compatibility with both ESP-IDF and Arduino framework #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added preprocessor macros to detect and separate ESP-IDF vs Arduino.
I've done some minor code refactor to enable the use of the library without any dependency on behalf of Arduino framework, but keeping it functional with it if the user intends to make use of Arduino.
The NO use of the Arduino framework is basically done by the following macro. Maybe it could be done in some other way:
The idea behind this, was to preserved as much code as possible intact, and just change what was necessary to make it work in esp-idf.
I've created some other macros for handling Arduino log_x and the use of millis():
Again, this is a proof of concept, and surely could be done more elegantly.
For what is worth, what triggered this effort was to find out that there is no proper maintained async web server library for esp-idf (!Arduino) and it seemed the right way to start. The original discussion can be found here
I hope we can merge this so as to continue the same work with ESPAsyncWebServer.