platformio / platform-espressif32

Espressif 32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif32
Apache License 2.0
926 stars 625 forks source link

Feature request: LDF scan for a new entry "mcu" #503

Open Jason2866 opened 3 years ago

Jason2866 commented 3 years ago

Configuration

Operating system: All

PlatformIO Version (platformio --version): latest development

Description of problem

Add a option to the LDF to scan for mcu in librarary.properties or in library.json mcu is already a entry in Arduino ESP32 boards.txt Esp32 has different mcu cores now (ESP32-C3 soon too) which needs different libraries. At the moment there is no possibility to differentiate this or did i missed something? Maybe as new command strict+ ?

ivankravets commented 3 years ago

It should be implemented in dev-platform. See https://github.com/espressif/arduino-esp32/blob/master/tools/platformio-build.py#L177

valeros commented 3 years ago

HI @Jason2866 ! Could you please provide an example of any library that needs this feature?

Jason2866 commented 3 years ago

Hi @valeros The ESPP3232-C3 is available. All libs which are compatible to core esp32 are used for the C3 too, as there is no possibility to handle the mcu variant with LDF. We have some optimized libs which are mcu dependent ( xtensa vs. riscv) it would be nice not to litter the code with many #ifdefs to take care of this. More elegant would be to have lib variants for every architecture

Examples: https://github.com/arendst/Tasmota/tree/development/lib/default/Ext-printf https://github.com/arendst/Tasmota/tree/development/lib/libesp32/Berry https://github.com/arendst/Tasmota/tree/development/lib/lib_ssl/bearssl-esp8266