From: Ivan Grokhotkov Date: Mon, 26 Sep 2016 09:06:12 +0000 (+0800) Subject: Merge branch 'feature/init_refactoring' into 'master' X-Git-Tag: v0.9~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3ffcd22d533f30550c53023c2c680a1f234f014;p=esp-idf Merge branch 'feature/init_refactoring' into 'master' Startup flow refactoring This set of commits changes the startup code in a way that lets the application choose if/when to initialize WiFi/BT. Application entry point is now a more familiar `main()` function. This function is executed in its own task. Application may choose to do some initialization from main function, create some tasks and then return from `main`. Simple applications may choose to do all their work from `main`. Additionally this MR splits event handling code into two parts. - One part is a set of standard handlers for WiFi and DHCP events. Most applications will use this set of handlers, and it is made available via new `esp_event_process_default` function. - Another part is the default implementation of event handling loop. Some applications may choose to use default event loop through `esp_event_loop_` set of APIs, which start an event handling task and call user-provided event callback from this task. Other applications may create an event queue and implement event loop themselves. In this case application has to provide `esp_event_send` function. In this case the implementation provided by `esp_event_loop_` module is unused. esp-idf-template has been updated to match this set of changes: https://github.com/espressif/esp-idf-template/tree/feature/init_refactoring BT example has also been updated. We need to provide examples of both event handling approaches. This will be done in a separate follow-up MR. See merge request !112 --- e3ffcd22d533f30550c53023c2c680a1f234f014