Skip to content

Commit

Permalink
Fix ethernet callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
mikee47 committed Nov 22, 2024
1 parent 4b3d1ca commit 0b94f02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sming/Arch/Esp32/Components/esp32/src/startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ extern "C" void app_main(void)

esp_event_loop_create_default();

#ifndef DISABLE_NETWORK
#ifndef DISABLE_WIFI
esp_network_initialise();
#endif

Expand Down
6 changes: 3 additions & 3 deletions Sming/Components/Network/Arch/Esp32/Platform/IdfService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
****/

#include <Platform/IdfService.h>
#include <Platform/System.h>
#include <esp_eth.h>
#include <esp_netif.h>
#include <esp_event.h>
Expand Down Expand Up @@ -54,10 +55,9 @@ void IdfService::enableEventCallback(bool enable)
auto handler = [](void* arg, esp_event_base_t, int32_t event_id, void*) {
auto service = static_cast<IdfService*>(arg);
service->state = Event(event_id);
if(!service->eventCallback) {
return;
if(service->eventCallback) {
System.queueCallback([service, event_id]() { service->eventCallback(Event(event_id)); });
}
service->eventCallback(Event(event_id));
};

if(enable) {
Expand Down

0 comments on commit 0b94f02

Please sign in to comment.