diff --git a/trunk/user/rc/src/detect_link.c b/trunk/user/rc/src/detect_link.c index f5906b96077..e347a2e165a 100644 --- a/trunk/user/rc/src/detect_link.c +++ b/trunk/user/rc/src/detect_link.c @@ -254,6 +254,11 @@ dl_on_timer(void) static void dl_update_leds(void) { + LED_CONTROL(LED_PWR, LED_ON); + LED_CONTROL(LED_WIFI, LED_ON); + LED_CONTROL(LED_SW2G, LED_ON); + LED_CONTROL(LED_SW5G, LED_ON); + int front_led_x; int dl_state; @@ -301,10 +306,6 @@ dl_update_leds(void) } #endif - LED_CONTROL(LED_WIFI, LED_ON); - LED_CONTROL(LED_PWR, LED_ON); - LED_CONTROL(LED_SW2G, LED_ON); - LED_CONTROL(LED_SW5G, LED_ON); LED_CONTROL(LED_ROUTER, (dl_is_ap_mode) ? LED_OFF : LED_ON); } diff --git a/trunk/user/rc/src/rc.c b/trunk/user/rc/src/rc.c index 4cdfede5793..7b7406e1eb6 100644 --- a/trunk/user/rc/src/rc.c +++ b/trunk/user/rc/src/rc.c @@ -593,8 +593,38 @@ setkernel_tz(void) settimeofday(tvp, &tz); } +#if defined (BOARD_K2P) +static void led_control(int gpio_led, int flag); + +void +LED_CONTROL(int gpio_led, int flag) +{ + switch (gpio_led) + { + case LED_PWR: + led_control(LED_WIFI, !flag); + led_control(LED_WAN, 0); + break; + case LED_WIFI: + led_control(LED_PWR, !flag); + led_control(LED_WAN, 0); + break; + case LED_WAN: + led_control(LED_PWR, 0); + led_control(LED_WIFI, !flag); + break; + default: + break; + } + led_control(gpio_led, flag); +} + +static void +led_control(int gpio_led, int flag) +#else void LED_CONTROL(int gpio_led, int flag) +#endif { int front_led_x = 1;