Skip to content

Commit

Permalink
IDF event loop only required for network applications
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Nov 25, 2024
1 parent e6e9d26 commit 6334970
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Sming/Arch/Esp32/Components/esp32/src/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ extern "C" void app_main(void)
smg_uart_detach_all();
esp_log_set_vprintf(m_vprintf);

esp_event_loop_create_default();

#ifndef DISABLE_WIFI
esp_network_initialise();
#endif
Expand Down
1 change: 1 addition & 0 deletions Sming/Components/Network/Arch/Esp32/Network/DM9051.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ DM9051PhyFactory DM9051Service::dm9051PhyFactory;
bool DM9051Service::begin(const Config& config)
{
esp_netif_init();
esp_event_loop_create_default();

esp_netif_config_t netif_cfg = ESP_NETIF_DEFAULT_ETH();
netif = esp_netif_new(&netif_cfg);
Expand Down
1 change: 1 addition & 0 deletions Sming/Components/Network/Arch/Esp32/Network/W5500.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ W5500PhyFactory W5500Service::w5500PhyFactory;
bool W5500Service::begin(const Config& config)
{
esp_netif_init();
esp_event_loop_create_default();

esp_netif_config_t netif_cfg = ESP_NETIF_DEFAULT_ETH();
netif = esp_netif_new(&netif_cfg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ bool EmbeddedEthernet::begin([[maybe_unused]] const Config& config)
#else

esp_netif_init();
esp_event_loop_create_default();
esp_netif_config_t cfg = ESP_NETIF_DEFAULT_ETH();
netif = esp_netif_new(&cfg);

Expand Down
1 change: 1 addition & 0 deletions Sming/Components/Network/Arch/Esp32/Platform/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ void esp_network_initialise()
* Initialise default WiFi stack
*/
esp_netif_init();
esp_event_loop_create_default();
ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, ESP_EVENT_ANY_ID, eventHandler, nullptr));
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, eventHandler, nullptr));
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
Expand Down

0 comments on commit 6334970

Please sign in to comment.