Merge pull request #352 from DrDoof/feat/health-cmd

health: a CLI dump of where the main loop's time goes
This commit is contained in:
feelfree69 authored and GitHub committed 2026-09-23 15:05:55 +02:00
commit 40177f6318
6 files changed
+285

No files matched your search

+10
View File
@@ -1015,6 +1015,7 @@ void handle_rx(void)
REG_SET(RTL837X_REG_NIC_RXCMD, 1);
return;
}
health_rx_frame();
#ifdef RXTXDBG
print_string("\n<< ");
@@ -1176,6 +1177,7 @@ void idle(void)
reg_read(RTL837X_REG_NIC_RX_BUFF_DATA);
if (!SFR_DATA_U16)
PCON |= 1;
health_loop_start();
if (sec_counter >= SYS_TICK_HZ) {
sec_counter -= SYS_TICK_HZ;
reg_read_m(RTL837X_REG_SEC_COUNTER);
@@ -1251,13 +1253,18 @@ void idle(void)
}
}
health_phase(HEALTH_PH_LINK);
// Check for changes with SFP modules
handle_sfp();
health_phase(HEALTH_PH_SFP);
// Check new Packets RX
handle_rx();
health_phase(HEALTH_PH_RX);
// Check UIP for packets to transmit
handle_tx();
health_phase(HEALTH_PH_TX);
// If STP protocol enabled, decrease STP timers to trigger actions
if (stp_enabled) {
if (!stp_clock) {
@@ -1267,6 +1274,7 @@ void idle(void)
stp_clock--;
}
}
health_phase(HEALTH_PH_STP);
// Check whether a command is waiting in the cmd_buffer and execute
if (cmd_available) {
cmd_available = 0;
@@ -1275,6 +1283,7 @@ void idle(void)
cmd_parser();
print_cmd_prompt();
}
health_phase(HEALTH_PH_CMD);
}
@@ -1769,6 +1778,7 @@ void main(void)
cmd_editor_init();
health_stack_paint();
while (1) {
cmd_edit();
idle(); // Enter Idle mode until interrupt occurs