header file of class and problem of including esp32 components

kyrpav
Posts: 10
Joined: Wed Jan 29, 2020 8:27 am

header file of class and problem of including esp32 components

Postby kyrpav » Wed May 20, 2020 12:11 am

i have a c++ project and i want to control a motor. I created a class (.h and .cpp files separated) that should implement the mcpwm.

I can include the "driver/mcpwm.h" in the .cpp file but in the .h file (where i want to declare some variables and the functions) the autocomplete does not find driver folder so the header can not be included.

PeterR
Posts: 370
Joined: Mon Jun 04, 2018 2:47 pm

Re: header file of class and problem of including esp32 components

Postby PeterR » Wed May 20, 2020 1:14 pm

Code: Select all

the autocomplete does not find driver folder
Autocomplete?

Usually you just:
#include "mcpwm.h"

Might help to quote your IDF version, makefile etc.
& I also believe that IDF CAN should be fixed.

kyrpav
Posts: 10
Joined: Wed Jan 29, 2020 8:27 am

Re: header file of class and problem of including esp32 components

Postby kyrpav » Wed May 20, 2020 7:51 pm

IDF version 4.2

makefile is :

Code: Select all

cmake_minimum_required(VERSION 3.5)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(motors)

when i say autocomplete is that when i write

Code: Select all

#include ""
i can use ctl+space to give me the available headers as i am writing inside quotes.
Index is rebuild but it is not resolved. I can do it normally in .cpp file where i allows me to add

Code: Select all

#include "driver/mcpwm.h"
but not in .h file.

As you can imagine i can not create an mcpwm_unit_t cause type can not be resolved (again in .h file)

PeterR
Posts: 370
Joined: Mon Jun 04, 2018 2:47 pm

Re: header file of class and problem of including esp32 components

Postby PeterR » Wed May 20, 2020 11:55 pm

What IDE are you using and how is it setup?

It is nice to have a well setup IDE but sometimes you can over sweat this stuff and good old typing is quicker ;)
& I also believe that IDF CAN should be fixed.

kyrpav
Posts: 10
Joined: Wed Jan 29, 2020 8:27 am

Re: header file of class and problem of including esp32 components

Postby kyrpav » Fri May 22, 2020 6:45 am

IDE is Eclipse 2020-03 and installation is done with the latest plugin version. System is Debian.

Used a blink example and changed the .c to .cpp and the makefile in proper way. I is working normally with other classes that i have separate .h and .cpp file.

I just can not include the components headers to the .h files.

Who is online

Users browsing this forum: Bing [Bot], burtrum and 14 guests