Return code from app_main ..?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Return code from app_main ..?

Postby kolban » Sat Nov 12, 2016 5:43 pm

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?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Return code from app_main ..?

Postby ESP_Angus » Sun Nov 13, 2016 11:29 pm

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

Who is online

Users browsing this forum: No registered users and 397 guests