Page 1 of 1

unable to include .h files from ESP-IDF components directory

Posted: Tue Feb 11, 2020 1:14 am
by Patrice
Hi,

I would like to add among other new ADC functions in the machine_adc.c. For that, I want to use esp_adc_cal.h include in my esp-idf/components directory.
If I build the Micropython for ESP32 without modifications, everything is OK, it works.
But as soos as I add the line #include "esp_adc_cal.h" in the machine_adc.c file, the build doesn't work. Make command return : fatal error: esp_adc_cal.h: No such file or directory. It's the same with all other files includes in my components directory.

IDF_PATH is well declared.
Is there something else to do for that ?

Many thanks

Re: unable to include .h files from ESP-IDF components directory

Posted: Tue Feb 11, 2020 10:11 pm
by jimmo
You need to add the additional include dirs -- if you look in ports/esp32/Makefile you can see the big list of -I flags that get created.

Re: unable to include .h files from ESP-IDF components directory

Posted: Wed Feb 12, 2020 4:05 am
by Patrice
Pefect, it works !
Thank you so much.

Re: unable to include .h files from ESP-IDF components directory

Posted: Fri Dec 03, 2021 2:49 pm
by dvrhax
Running into the same issue however my makefile has no reference to -I and idf.py doesn't show it as an option and when I try to execute it anyway, I receive:
Error: No such option: -I
Any insight would be appreciated.

Thank you

Re: unable to include .h files from ESP-IDF components directory

Posted: Tue Dec 07, 2021 4:46 pm
by dvrhax
Nevermind I figured it out. I must have flubbed the git checkout back to 4.2 and was working with 5.0 which through all the logic off in main/CMakeLists.txt