Search found 11 matches

by Elijahg
Mon Mar 11, 2019 12:47 am
Forum: ESP32 IDF
Topic: Mapping GPIO pins to ADC channel
Replies: 0
Views: 257

Mapping GPIO pins to ADC channel

Hi guys, I've searched and examined headers for quite some time but am yet to come up with an answer. Is there a function or macro that will map a gpio_num_t to adc1_channel_t? There is an adc1_pad_get_io_num function which converts adc1_channel_t to gpio_num_t (i.e. ADC channel to GPIO pin), but si...
by Elijahg
Thu Feb 07, 2019 3:51 am
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

I've managed to fix the example code so that it'll compile with C++! The erroring lines (81-85 and 376-381) are actually structs of type sockaddr_in and mwifi_config_t. C supports designated initializers whereas C++ does not, and apparently even when compiled with 'extern "C"' around them, they're s...
by Elijahg
Wed Feb 06, 2019 11:33 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

I've posted a comment on the Github issue relating to this, as I still feel the examples should compile as C++ without having to include the functions through a class.
by Elijahg
Wed Feb 06, 2019 10:36 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

Do you have app_main1() defined in get_started.h and in get_started.c? You should then have app_main() defined in lee.cpp only Yup. A couple of other thoughts.... 1. you did put the lee files and the get_started.h in the main directory with the get_started.c file? 2. you could try a "make clean" an...
by Elijahg
Wed Feb 06, 2019 7:43 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

Thanks again Lee for your help, I've renamed get_started.cpp back to get_started.c, and - this is getting ridiculous now - it compiles, but the linker can't find app_main... I guess the linker is ignoring the lee.o file. $ make [snip] Generating libwpa_supplicant.a.sections_info Generating libxtensa...
by Elijahg
Wed Feb 06, 2019 3:45 am
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

Thanks again Lee for your reply. I completely reset my esp-mdf directory so it's identical to the Espressif repo. I've tried your files in the main directory but unfortunately I still get the same errors as before... arrgh! $ make clean; make [snip] /Users/elijah/esp/get-started/main/get_started.cpp...
by Elijahg
Tue Feb 05, 2019 5:52 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

Thanks again for your quick reply Lee. I'm simply using make, with no options. $ make Toolchain path: /Users/elijah/esp/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc Toolchain version: crosstool-ng-1.22.0-80-g6c4433a Compiler version: 5.2.0 Python requirements from /Users/elijah/esp-mdf/esp-idf/requirem...
by Elijahg
Tue Feb 05, 2019 3:55 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

Unfortunately it still doesn't compile after casting the malloc. I now get a vast number of errors and warnings. A lot of them seem to be related to designated initializers, which don't exist in C++, and the compiler still isn't happy when the struct with designated initializers is wrapped in extern...
by Elijahg
Mon Feb 04, 2019 5:48 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Re: Using the MDF with C++

Hi Lee, Many thanks for your reply. I am compiling it in VScode on macOS, but through its built-in terminal; I'm just using VScode as a text editor. Sorry I should have noted previously that it compiles and runs fine when it's just the original unmodified .c file without the extern C - including the...
by Elijahg
Sun Feb 03, 2019 9:05 pm
Forum: ESP32 MDF
Topic: Using the MDF with C++
Replies: 22
Views: 3077

Using the MDF with C++

Hi, I'm trying to use the Mesh Development Framework within a C++ program. Unfortunately I'm not able to get past the most simple "get_started.c". I've renamed the get_started.c example to get_started.cpp, which breaks the compilation due to it using - presumably - the C++ compiler. I've tried wrapp...

Go to advanced search