Hello,
I am using light sleep on an ESP32. I have a button with a pullup attached to pin 34, which pulls pin 34 to ground when pressed.I use gpio_wakeup_enable(34, GPIO_INTR_LOW_LEVEL) to enable waking from light sleep on this pin. I have an edge interrupt on this pin too for use when the program ...
Search found 12 matches
- Sun Jul 30, 2023 5:46 pm
- Forum: ESP-IDF
- Topic: gpio_wakeup_enable() Causes WDT crash
- Replies: 0
- Views: 6355
- Mon Mar 11, 2019 12:47 am
- Forum: ESP-IDF
- Topic: Mapping GPIO pins to ADC channel
- Replies: 1
- Views: 5097
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 ...
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 ...
- Thu Feb 07, 2019 3:51 am
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
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 ...
- Wed Feb 06, 2019 11:33 pm
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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.
- Wed Feb 06, 2019 10:36 pm
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
- Wed Feb 06, 2019 7:43 pm
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
$ make
[snip]
Generating libwpa_supplicant.a.sections_info
Generating ...
- Wed Feb 06, 2019 3:45 am
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
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 ...
- Tue Feb 05, 2019 5:52 pm
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
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 ...
- Tue Feb 05, 2019 3:55 pm
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
- Mon Feb 04, 2019 5:48 pm
- Forum: ESP-MDF
- Topic: Using the MDF with C++
- Replies: 22
- Views: 36299
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 ...
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 ...