Changeset 35651


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

cns21xx: 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/cns21xx/base-files/etc/diag.sh

    r24859 r35651  
    11#!/bin/sh 
    2 # 
    3 # Copyright (C) 2010 OpenWrt.org 
    4 # 
    5 # 
     2# Copyright (C) 2010-2013 OpenWrt.org 
    63 
     4. /lib/functions/leds.sh 
    75. /lib/cns21xx.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() { 
     
    4319        preinit) 
    4420                insmod leds-gpio 
    45                 status_led_set_timer 200 200 
     21                status_led_blink_preinit 
    4622                ;; 
    4723        failsafe) 
    48                 status_led_set_timer 50 50 
     24                status_led_blink_failsafe 
    4925                ;; 
    5026        done) 
Note: See TracChangeset for help on using the changeset viewer.