ESP-IDF in VSCode creating a custom project structure.

zazas321
Posts: 231
Joined: Mon Feb 01, 2021 9:41 am

ESP-IDF in VSCode creating a custom project structure.

Postby zazas321 » Wed Dec 08, 2021 10:40 am

Hello. Usually, for my ESP32 projects I put all my .c and .h file inside components folder. I think this is the default structure for the eso-idf projects.

It looks like:
├── Components
| └── Component1
| | └── Component1.c
| | └── Component1.h
| └── Component2
| | └── Component2.c
| | └── Component2.h


However, some of the components I would like to split as drivers. I want to keep drivers seperate to the rest of the component. Something like:

├── Components
| └──Component1
| | └── Component1.c
| | └── Component1.h
| └── Component2
| | └── Component2.c
| | └── Component2.h
| └── Drivers
| | └── Driver1
| | | └── Driver1.c
| | | └── Driver1.h


I have tried to do that but when I try to include my driver header file, I get the following eerror:

Code: Select all

#include "drivers/ACS71020.h"

Code: Select all

In file included from ../main/main.cpp:8:
../main/main.h:32:10: fatal error: drivers/ACS71020.h: No such file or directory
 #include "drivers/ACS71020.h"

Could someone help me understand how can this be solved.

Who is online

Users browsing this forum: No registered users and 117 guests