Page 1 of 1

Return code from app_main ..?

Posted: Sat Nov 12, 2016 5:43 pm
by kolban
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?

Re: Return code from app_main ..?

Posted: Sun Nov 13, 2016 11:29 pm
by ESP_Angus
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