From c31b67572bce4284e41cca10d59417e01bfb5340 Mon Sep 17 00:00:00 2001 From: SkullyDev <7769743+SkullyDev@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:03:42 +0300 Subject: [PATCH] Remove led behavior & LED comments Should work without gpio_input_setup --- machine.c | 20 +++++++++++--------- machine.h | 1 - machine_init.c | 7 ------- rtlplayground.c | 12 ++---------- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/machine.c b/machine.c index e7eb7618..6d53e1e7 100644 --- a/machine.c +++ b/machine.c @@ -1234,25 +1234,27 @@ __code const struct machine machine = { .max_port = 8, .n_sfp = 0, .n_10g = 2, - .sys_led_mode = SYS_LED_SLOW, .log_to_phys_port = {0, 0, 0, 5, 1, 2, 3, 4, 6}, .phys_to_log_port = {4, 5, 6, 7, 3, 8, 0, 0, 0}, .is_sfp = {0, 0, 0, 0, 0, 0, 0, 0, 0}, .reset_pin = GPIO54_ACL_BIT2_EN, .high_leds = { .mux = LED_28_SYS | LED_29, .enable = LED_28_SYS | LED_29 }, .port_led_set = { 0, 0, 0, 1, 0, 0, 0, 0, 1 }, + /* Ports 1-4: Green: 2.5GBit, Orange: 10/100/1000MBit + * Ports 5-6: Green: 10GBit, Orange: 5/2.5GBit, None: 10/100/1000MBit + */ .led_sets = { { - LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, - LEDS_2G5 | LEDS_LINK, - LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK, - 0, + LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, // Yellow + LEDS_2G5 | LEDS_LINK, // Green + LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK, // Orange + 0, // Unused }, { - LEDS_10G | LEDS_5G | LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, - LEDS_10G | LEDS_LINK, - LEDS_5G | LEDS_2G5 | LEDS_LINK, - 0, + LEDS_10G | LEDS_5G | LEDS_2G5 | LEDS_1G | LEDS_100M | LEDS_10M | LEDS_LINK | LEDS_ACT, // Yellow + LEDS_10G | LEDS_LINK, // Green + LEDS_5G | LEDS_2G5 | LEDS_LINK, // Orange + 0, // Unused }, }, .led_mux_custom = 1, diff --git a/machine.h b/machine.h index 98e5abee..099d28f1 100644 --- a/machine.h +++ b/machine.h @@ -78,7 +78,6 @@ struct sfp_port typedef struct machine { char machine_name[30]; uint8_t isRTL8373; - uint8_t sys_led_mode; // Lowest logical port number uint8_t min_port; // Highest logical port number diff --git a/machine_init.c b/machine_init.c index aa10a0f5..2f674a33 100644 --- a/machine_init.c +++ b/machine_init.c @@ -117,13 +117,6 @@ void machine_custom_init(void) __banked REG_SET(RTL837X_REG_LED_GLB_IO_EN, 0x7624155b); } -#elif defined MACHINE_HASIVO_S600W_4GT_2XGT_SE -void machine_custom_init(void) __banked -{ - // For this device, the reset button triggers this input - gpio_input_setup(GPIO54_ACL_BIT2_EN); -} - #else void machine_custom_init(void) __banked { } #endif diff --git a/rtlplayground.c b/rtlplayground.c index 5f5ce64e..a2efbf5a 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -1141,11 +1141,7 @@ void handle_button(void) else { print_string("Short button press detected; no action.\n"); - if (machine.sys_led_mode) { - set_sys_led_state(machine.sys_led_mode); - } else { - set_sys_led_state(SYS_LED_ON); - } + set_sys_led_state(SYS_LED_ON); } } else @@ -1751,11 +1747,7 @@ void main(void) print_cmd_prompt(); idle_ready = 1; - if (machine.sys_led_mode) { - set_sys_led_state(machine.sys_led_mode); - } else { - set_sys_led_state(SYS_LED_ON); - } + set_sys_led_state(SYS_LED_ON); cmd_editor_init();