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.
header file of class and problem of including esp32 components
Re: header file of class and problem of including esp32 components
Code: Select all
the autocomplete does not find driver folder
Usually you just:
#include "mcpwm.h"
Might help to quote your IDF version, makefile etc.
& I also believe that IDF CAN should be fixed.
Re: header file of class and problem of including esp32 components
IDF version 4.2
makefile is :
when i say autocomplete is that when i write 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
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)
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 ""
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"
As you can imagine i can not create an mcpwm_unit_t cause type can not be resolved (again in .h file)
Re: header file of class and problem of including esp32 components
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
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.
Re: header file of class and problem of including esp32 components
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.
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: No registered users and 81 guests