I think there's a post on this earlier, but the big issue with moving to IDF5 is the network connection handling - IDF4 introduced a new API but still had a backwards compatibility layer, but IDF5 gets rid of that layer so you'd have to completely rewrite Espruino's handling. I took a look initially but it appears to be a decent chunk of work, which is why I stuck with IDF4 for now.
start a fresh and , build a new 5.1 (say) idf sdk espruino port
without the #idefs for each of the current idf variants
I'm pretty sure there will always be IFDEFs needed for each hardware variant - certain hardware peripherals will be present in some but not others, or in different places. So as an example:
But personally I feel like given the thousands of lines of code in the esp32 port, there are actually very few ifdefs needed to move to IDF4. And the ones that are could be improved greatly.
For example, if we added a idf3_compat.h file with:
You could basically remove every #if ESP_IDF_VERSION_MAJOR>=4 line from that file. And the same kind of thing for other files too - I'd be up for doing something like that, and then at some point if we do want to drop support for older IDFs it's just a matter of deleting that file.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I think there's a post on this earlier, but the big issue with moving to IDF5 is the network connection handling - IDF4 introduced a new API but still had a backwards compatibility layer, but IDF5 gets rid of that layer so you'd have to completely rewrite Espruino's handling. I took a look initially but it appears to be a decent chunk of work, which is why I stuck with IDF4 for now.
So you're suggesting basically copying the entirety of https://github.com/espruino/Espruino/tree/master/targets/esp32 and starting again?
I'm pretty sure there will always be IFDEFs needed for each hardware variant - certain hardware peripherals will be present in some but not others, or in different places. So as an example:
But personally I feel like given the thousands of lines of code in the esp32 port, there are actually very few ifdefs needed to move to IDF4. And the ones that are could be improved greatly.
For example, if we added a
idf3_compat.h
file with:You could basically remove every
#if ESP_IDF_VERSION_MAJOR>=4
line from that file. And the same kind of thing for other files too - I'd be up for doing something like that, and then at some point if we do want to drop support for older IDFs it's just a matter of deleting that file.