Hello,
is there anyone who programs in c++ with Lyrat? Why examples in ADF sdk are in C?
Thanks all.
Bye
C++ programming with ESP32 Lyrat
- shabtronic
- Posts: 49
- Joined: Sun Nov 03, 2019 1:33 pm
Re: C++ programming with ESP32 Lyrat
Why C over C++?
C is traditionally used in embedded because of it lightweight nature. C++ can be rather heavy on memory usage esp with STl.
With C you can control where your memory is allocated - dram or spi ram - very easily with the esp malloc. With C++ and STL it's rather complicated to write a custom allocator to control dram/spi ram allocation.
I use C++ it's great with STL - but you have to do alot of work not to use up all the dram.
C is traditionally used in embedded because of it lightweight nature. C++ can be rather heavy on memory usage esp with STl.
With C you can control where your memory is allocated - dram or spi ram - very easily with the esp malloc. With C++ and STL it's rather complicated to write a custom allocator to control dram/spi ram allocation.
I use C++ it's great with STL - but you have to do alot of work not to use up all the dram.
Re: C++ programming with ESP32 Lyrat
ok thank you for your replay.
I like c++ and it is very useful in more complicated project.
But in this case, lyrat, I need to be not expansive with resources.
thank you.
I like c++ and it is very useful in more complicated project.
But in this case, lyrat, I need to be not expansive with resources.
thank you.
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: C++ programming with ESP32 Lyrat
Note that C and C++ are mostly interoperable, and ESP-IDF (the SDK ESP-ADF is built on top of) supports the base C++ language as well. You should be able to write additions for ADF in C++ if you so desire, even if we don't have explicit examples of it.
Re: C++ programming with ESP32 Lyrat
thank you, for me it is very encouraging.ESP_Sprite wrote: ↑Mon Feb 03, 2020 9:53 amNote that C and C++ are mostly interoperable, and ESP-IDF (the SDK ESP-ADF is built on top of) supports the base C++ language as well. You should be able to write additions for ADF in C++ if you so desire, even if we don't have explicit examples of it.
Who is online
Users browsing this forum: No registered users and 10 guests