• 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

    So you're suggesting basically copying the entirety of https://github.com/espruino/Espruino/tree/master/targets/esp32 and starting again?

    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:

    [#define](https://forum.espruino.com/search/?q=%23define) ADC_ATTEN_DB_0 ADC_ATTEN_0db
    ...
    [#define](https://forum.espruino.com/search/?q=%23define) ADC_WIDTH_BIT_12 ADC_WIDTH_12Bit
    [#define](https://forum.espruino.com/search/?q=%23define) dac_output_voltage dac_out_voltage
    [#define](https://forum.espruino.com/search/?q=%23define) adc1_get_raw adc1_get_voltage
    

    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.

About

Avatar for Gordon @Gordon started