Search found 45 matches

by MikeLemon
Sun May 22, 2022 4:34 pm
Forum: ESP-IDF
Topic: How to link extern variable defines in a header file to the main source file?
Replies: 4
Views: 2760

Re: How to link extern variable defines in a header file to the main source file?

I Actually figured out what I did wrong to achieve "linking global variable" from one source file to another or the main.c so what I did is first defined the global variables I want to init in say funcs1.c and then declared it in it's header file funcs1.h note there is a difference between define an...
by MikeLemon
Sat May 21, 2022 8:14 am
Forum: ESP-IDF
Topic: How to link extern variable defines in a header file to the main source file?
Replies: 4
Views: 2760

Re: How to link extern variable defines in a header file to the main source file?

Hi there, Yes I have included that in the main.c file yes, and I have the header in the same folder and the cmakelists.txt file looks as such: idf_component_register(SRCS "main.c" "u8g2_esp32_hal.c" "my_inits.c" "button_funcs.c" INCLUDE_DIRS "." ) which I assume it's the same as what you mentioned i...
by MikeLemon
Fri May 20, 2022 7:51 pm
Forum: ESP-IDF
Topic: How to link extern variable defines in a header file to the main source file?
Replies: 4
Views: 2760

How to link extern variable defines in a header file to the main source file?

I'm trying to access a variables defines in a file I created named button_funcs.h in the same directory as the main.c file and there I defined a freeRTOS QHandle such as extern xQueueHandle DoItQ; ,when I come to compile it with CMake it gives me the following error: c:/coding/esp32/.espressif/tools...
by MikeLemon
Mon May 09, 2022 3:55 pm
Forum: ESP-IDF
Topic: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)
Replies: 6
Views: 2975

Re: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)

Thanks again for saving the day and being super useful once again very appreciated, The esp-drone example is particularly useful I'll try compiling my code with a CMAKE structure similar to his and see how I get started going with the idf_component_register() components registration method in cmake ...
by MikeLemon
Sun May 08, 2022 4:47 pm
Forum: ESP-IDF
Topic: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)
Replies: 6
Views: 2975

Re: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)

I was just sure that's how programmers with big system projects do it this way since using the file concatenation method is realy just a cut and paste solution rather then then header file library approach which requires more involvement and thinking which is hard and sucks when no-one pays you to d...
by MikeLemon
Sat May 07, 2022 8:35 am
Forum: ESP-IDF
Topic: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)
Replies: 6
Views: 2975

Re: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)

The reason behind splitting and concatenating files rather than make a library for each is that the functions I write and want to put in the other source files activate and read other functions and global variables from the main.c file that I want to access there without tripling or more my work by ...
by MikeLemon
Fri May 06, 2022 4:59 pm
Forum: ESP-IDF
Topic: Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)
Replies: 6
Views: 2975

Concatenating and compiling multiple source files in ESP IDF CMAKE? (Similar to arduino tabs)

I'm trying to split my code to multiple files for the sake of code clarity and ease of debugging since I notices I'm scrolling too much ,trying to achieve it like with arduino tabs as this guys explains here: https://www.youtube.com/watch?v=HtYlQXt14zU does anybody know how to do it or if it's possi...
by MikeLemon
Wed Apr 27, 2022 5:43 pm
Forum: ESP-IDF
Topic: How to setup CMAKE to compile with more than one executable(main.c)?
Replies: 4
Views: 4691

Re: How to setup CMAKE to compile with more than one executable(main.c)?

Could you please share your project code (either as a .zip file or in a Github repository)? I'll see if I can suggest you specific changes to make that work. I'm sorry, I am unable to fully understand your last comment. One thing I did notice is that you are calling idf_component_register with both...
by MikeLemon
Wed Apr 27, 2022 4:26 pm
Forum: ESP-IDF
Topic: How to setup CMAKE to compile with more than one executable(main.c)?
Replies: 4
Views: 4691

Re: How to setup CMAKE to compile with more than one executable(main.c)?

Hello igrr, good component day for you :) When I put only idf_component_register(SRCS "main.c" "u8g2_esp32_hal.c" "my_inits.c" SRC_DIRS "." "../components" INCLUDE_DIRS "../components") it gives me errors making me unable to even build a directory unlike using the method I used in the posted in the ...
by MikeLemon
Tue Apr 26, 2022 4:02 pm
Forum: ESP-IDF
Topic: How to setup CMAKE to compile with more than one executable(main.c)?
Replies: 4
Views: 4691

How to setup CMAKE to compile with more than one executable(main.c)?

the main file main.c in my project got quite large more than 1000 lines a code with more than 30 lines of lib #include<lib.h> code. I'd like to split the main source file into two or more files and have them work as one and shade includes and relation with each other like how you're able to split ex...