Changeset 35650


Ignore:
Timestamp:
2013-02-18T10:56:27+01:00 (5 years ago)
Author:
juhosg
Message:

ar71xx: migrate to common led helper functions

[juhosg: migrate to status_led_blink_{preinit,failsafe} helpers]

Signed-off-by: Michael Heimpold <mhei@…>
Signed-off-by: Gabor Juhos <juhosg@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/ar71xx/base-files/etc/diag.sh

    r35429 r35650  
    11#!/bin/sh 
    2 # 
    3 # Copyright (C) 2009 OpenWrt.org 
    4 # 
    5 # 
     2# Copyright (C) 2009-2013 OpenWrt.org 
    63 
     4. /lib/functions/leds.sh 
    75. /lib/ar71xx.sh 
    8  
    9 status_led="" 
    10  
    11 led_set_attr() { 
    12         [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" 
    13 } 
    14  
    15 status_led_set_timer() { 
    16         led_set_attr $status_led "trigger" "timer" 
    17         led_set_attr $status_led "delay_on" "$1" 
    18         led_set_attr $status_led "delay_off" "$2" 
    19 } 
    20  
    21 status_led_on() { 
    22         led_set_attr $status_led "trigger" "none" 
    23         led_set_attr $status_led "brightness" 255 
    24 } 
    25  
    26 status_led_off() { 
    27         led_set_attr $status_led "trigger" "none" 
    28         led_set_attr $status_led "brightness" 0 
    29 } 
    306 
    317get_status_led() { 
     
    201177                status_led="zcn-1523h:amber:init" 
    202178                ;; 
    203         esac; 
     179        esac 
    204180} 
    205181 
     
    212188                insmod ledtrig-default-on 
    213189                insmod ledtrig-timer 
    214                 status_led_set_timer 200 200 
     190                status_led_blink_preinit 
    215191                ;; 
    216192        failsafe) 
    217                 status_led_set_timer 50 50 
     193                status_led_blink_failsafe 
    218194                ;; 
    219195        done) 
Note: See TracChangeset for help on using the changeset viewer.