Hello,
I'm using Eclipse Neon.2 and i need to use ADC and BLE for my project.
I started from gatt_example and with a little of work i have been able to fully compile and flash the project on my devkit. I'm trying to add the adc part so this is what i did:
1) I added to the "include" paths of the project properties: "${IDF_PATH}/components/driver/include/driver" that is the folder where "adc.h" is
2) I called the needed code (setting width, attenuation and get voltage). Please note that functions have been recognized and can be explored with the hotkey (CTRL+click)
The problem is that when i try to compile i get error "adc.h no such file or directory". Please note that if i CTRL+click on "adc.h" in the include i can explore the library. I just don't understand how is possible that i'm able to explore the files and the function but i get this error.
Any suggestion?
Thank you!
Frax
#include adc.h
Re: #include adc.h
Add include path ${IDF_PATH}/components/driver/include
and use
and use
Code: Select all
#include "driver/adc.h"
Re: #include adc.h
It works! Thank you very much.
Can anyone explain me why the way i did was not right?
Frax
Can anyone explain me why the way i did was not right?
Frax
Re: #include adc.h
The Eclipse environment allows us to supply a set of directories which the "editor" searches for entry assist and validation. Thus when you edited your Eclipse environment paths, the editor was able to find them and any warning you had about unresolved includes (as produced by the editor) went away. However, if you are using the out-of-the-box ESP-IDF build system and just running "make" then that uses its own build directories locations that are dynamically located based on the ESP-IDF component concept see ...
http://esp-idf.readthedocs.io/en/latest ... ystem.html
The ESP-IDF build system knows nothing about the paths you set to satisfy the Eclipse editor.
http://esp-idf.readthedocs.io/en/latest ... ystem.html
The ESP-IDF build system knows nothing about the paths you set to satisfy the Eclipse editor.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: #include adc.h
I see,
so, if i well understand, it's not important that the path i set is correct. It's important that the "syntax" i use in the #include is the same one the pre-built ESP-IDF expects. Can you confirm?
Thank you as usual
Frax
so, if i well understand, it's not important that the path i set is correct. It's important that the "syntax" i use in the #include is the same one the pre-built ESP-IDF expects. Can you confirm?
Thank you as usual
Frax
Re: #include adc.h
Frax,
Yes sir ... that's correct. By and large, the directory that is called:
<component>/include
Is added to the include lookup path in the build system.
So if there is a component called XYZ then <XYZ>/include will be in the build path.
If we look at the "driver" component ... we see that it has an include directory which ... itself ... has a directory called "driver" within it ... hence the need to #include <driver/adc.h>
Yes sir ... that's correct. By and large, the directory that is called:
<component>/include
Is added to the include lookup path in the build system.
So if there is a component called XYZ then <XYZ>/include will be in the build path.
If we look at the "driver" component ... we see that it has an include directory which ... itself ... has a directory called "driver" within it ... hence the need to #include <driver/adc.h>
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: #include adc.h
Understood!
Thank you!
frax
Thank you!
frax
Who is online
Users browsing this forum: No registered users and 107 guests