IDF Component
IDF Component
Hi guys! I have a big simple question. Why in IDF Component tutorial (https://github.com/espressif/arduino-es ... mponent.md) , if I don't select arduino auto start, I need to put "InitArduino()" in app_main, why? What that do? I try with and without this function, and both worked very well and similar.
Re: IDF Component
When I read docs and the developer provides "instructions" on how to setup, I usually trust their judgement on what that means. If we look at the following source code:
https://github.com/espressif/arduino-es ... misc.c#L80
We see what initArduino() apparently does. It doesn't look very big and at a minimum, it seems to initialize NVS flash support and then call init() and initVariant(). So that's "technically" what it does. Logically, I think the intent is to perform whatever initialization the Arduino libraries may need.
If we look at the auto start code found here:
https://github.com/espressif/arduino-es ... in.cpp#L24
We see it does the same thing (i.e. calls initArduino() before passing control to setup/loop.
https://github.com/espressif/arduino-es ... misc.c#L80
We see what initArduino() apparently does. It doesn't look very big and at a minimum, it seems to initialize NVS flash support and then call init() and initVariant(). So that's "technically" what it does. Logically, I think the intent is to perform whatever initialization the Arduino libraries may need.
If we look at the auto start code found here:
https://github.com/espressif/arduino-es ... in.cpp#L24
We see it does the same thing (i.e. calls initArduino() before passing control to setup/loop.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: IDF Component
Yeah, I see this code's, thank's for reply! I will test some arduino libraries with and without this function to see what happens and post observations ..kolban wrote:When I read docs and the developer provides "instructions" on how to setup, I usually trust their judgement on what that means. If we look at the following source code:
https://github.com/espressif/arduino-es ... misc.c#L80
We see what initArduino() apparently does. It doesn't look very big and at a minimum, it seems to initialize NVS flash support and then call init() and initVariant(). So that's "technically" what it does. Logically, I think the intent is to perform whatever initialization the Arduino libraries may need.
If we look at the auto start code found here:
https://github.com/espressif/arduino-es ... in.cpp#L24
We see it does the same thing (i.e. calls initArduino() before passing control to setup/loop.
Re: IDF Component
I'm of a mind set that says if the developer of a library says "call XYZ()" before using the library then I had better "call XYZ()" before using it. I'm afraid I'm missing the notion of even asking the question "Why are we calling XYZ()"?
My doctor told me, "Don't drink grapefruit juice while taking this medicine". I have no intention of drinking grapefruit juice while taking the drug "just to see what happens"
My doctor told me, "Don't drink grapefruit juice while taking this medicine". I have no intention of drinking grapefruit juice while taking the drug "just to see what happens"
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: IDF Component
Of course, developers who understand better and tell us what to do, exactly like their medical example, however it is interesting to understand the reasons for future if necessary, identify errors, bugs or methods to increase code effectiveness. For now, all tests I did with some libraries of Arduino core worked without any problems .. I will continue to analyze.kolban wrote:I'm of a mind set that says if the developer of a library says "call XYZ()" before using the library then I had better "call XYZ()" before using it. I'm afraid I'm missing the notion of even asking the question "Why are we calling XYZ()"?
My doctor told me, "Don't drink grapefruit juice while taking this medicine". I have no intention of drinking grapefruit juice while taking the drug "just to see what happens"
Who is online
Users browsing this forum: Google [Bot] and 91 guests