From 1f2b6c5d44680c64c651c2cbb768af537c40cbb2 Mon Sep 17 00:00:00 2001 From: BuGu <62454025+Z2Z-GuGu@users.noreply.github.com> Date: Tue, 15 Apr 2025 14:31:07 +0800 Subject: [PATCH] Optimize IP display logic. WiFi version: Only display the corresponding IP when either ETH or WiFi is present; otherwise, both IPs will alternate. --- support/sg2002/kvm_system/main/lib/oled_ui/oled_ui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/support/sg2002/kvm_system/main/lib/oled_ui/oled_ui.cpp b/support/sg2002/kvm_system/main/lib/oled_ui/oled_ui.cpp index 20b6a1e..177af9b 100644 --- a/support/sg2002/kvm_system/main/lib/oled_ui/oled_ui.cpp +++ b/support/sg2002/kvm_system/main/lib/oled_ui/oled_ui.cpp @@ -140,6 +140,8 @@ int qrencode(char *string) ip_addr_t show_which_ip(void) { if(kvm_sys_state.wifi_state == -2) return ETH_IP; + if(kvm_oled_state.eth_state == 3 && kvm_oled_state.wifi_state != 1) return ETH_IP; + if(kvm_oled_state.eth_state != 3 && kvm_oled_state.wifi_state == 1) return WiFi_IP; static uint8_t run_count = 0; static ip_addr_t ip_type = ETH_IP; run_count++;