In our current ESP-IDF, we find that app_main has the signature "int app_main(void)". This is the function we must define as the entry point into our custom logic. This now begs the question ... what if anything does the return code from app_main() mean or do?
My best guess is looking here:
https://github.com/espressif/esp-idf/bl ... art.c#L223
Which shows that no return code is used. Digging further, we find that the signature for THAT call is "extern void app_main(void)". Notice that the return from app_main() is declared as void.
Might this mean that our samples declared as returning an "int" are mistaken and they should really be defined as void types?
Return code from app_main ..?
Return code from app_main ..?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Return code from app_main ..?
Hi Kolban,
You are correct that this is wrong. The type signature should be void app_main(void);. It looks like the idf-template and one of the bundled examples needs to be updated to reflect this, I'll do so.
Angus
You are correct that this is wrong. The type signature should be void app_main(void);. It looks like the idf-template and one of the bundled examples needs to be updated to reflect this, I'll do so.
Angus
Who is online
Users browsing this forum: No registered users and 278 guests