Changeset 35649


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

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

    r19001 r35649  
    11#!/bin/sh 
    2 # 
    3 # Copyright (C) 2007 OpenWrt.org 
    4 # 
    5 # 
     2# Copyright (C) 2007-2013 OpenWrt.org 
    63 
     4. /lib/functions/leds.sh 
    75. /lib/adm5120.sh 
    8  
    9 led_set_attr() { 
    10         [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" 
    11 } 
    12  
    13 status_led_set_timer() { 
    14         led_set_attr $status_led "trigger" "timer" 
    15         led_set_attr $status_led "delay_on" "$1" 
    16         led_set_attr $status_led "delay_off" "$2" 
    17 } 
    18  
    19 status_led_set_morse() { 
    20         led_set_attr $status_led "trigger" "morse" 
    21         led_set_attr $status_led "delay" "$1" 
    22         led_set_attr $status_led "message" "$2" 
    23 } 
    24  
    25 status_led_on() { 
    26         led_set_attr $status_led "trigger" "none" 
    27         led_set_attr $status_led "brightness" 255 
    28 } 
    29  
    30 status_led_off() { 
    31         led_set_attr $status_led "trigger" "none" 
    32         led_set_attr $status_led "brightness" 0 
    33 } 
    346 
    357set_state() { 
     
    379        preinit) 
    3810                insmod leds-gpio 
    39                 status_led_set_timer 200 200 
     11                status_led_blink_preinit 
    4012                ;; 
    4113        failsafe) 
    42                 status_led_set_timer 50 50 
     14                status_led_blink_failsafe 
    4315                ;; 
    4416        done) 
Note: See TracChangeset for help on using the changeset viewer.