Skip to content

Commit e403fff

Browse files
committed
ethernet, debug: Fix EMAC task stack size display
1 parent 9cda22b commit e403fff

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

software/src/modules/debug/debug.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,6 @@ void Debug::register_events()
11091109
}
11101110

11111111
register_task(TCPIP_THREAD_NAME,TCPIP_THREAD_STACKSIZE);
1112-
register_task("emac_rx", 2304, Optional); // stack size set by us in ethernet.cpp
11131112
register_task("wifi", 6656, ExpectPresent); // stack size observed at runtime from task creation
11141113
register_task("sys_evt", ESP_TASKD_EVENT_STACK); // created in WiFiGeneric.cpp
11151114
register_task("arduino_events", 4096); // stack size from WiFiGeneric.cpp

software/src/modules/ethernet/ethernet.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
#include "gcc_warnings.h"
4949

50+
constexpr size_t EMAC_TASK_STACK_SIZE = 2560;
51+
5052
static constexpr uint8_t IGMP_MAC[6] = {0x01, 0x00, 0x5e, 0x00, 0x00, 0x01};
5153

5254
// Generation counter for async ETH.begin() tasks. Incremented on every
@@ -250,6 +252,10 @@ void Ethernet::setup()
250252

251253
state.get("mac")->updateString(String{mac_str, len});
252254
state.get("connection_state")->updateEnum(this->runtime_data->connection_state);
255+
256+
#if MODULE_DEBUG_AVAILABLE()
257+
debug.register_task("emac_rx", EMAC_TASK_STACK_SIZE);
258+
#endif
253259
});
254260
},
255261
ARDUINO_EVENT_ETH_START);
@@ -472,7 +478,7 @@ void Ethernet::setup()
472478
},
473479
ARDUINO_EVENT_ETH_STOP);
474480

475-
ETH.setTaskStackSize(2560);
481+
ETH.setTaskStackSize(EMAC_TASK_STACK_SIZE);
476482

477483
apply_config();
478484
}

software/src/modules/ethernet/module.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Requires = Task Scheduler
1515
; Default: empty list
1616
Optional = Network
1717
Wifi
18+
Debug
1819

1920
; A list of modules that this module must be loaded after, if they are enabled.
2021
; Default: empty list

0 commit comments

Comments
 (0)