Changeset 35661


Ignore:
Timestamp:
2013-02-18T11:37:55+01:00 (5 years ago)
Author:
florian
Message:

brcm63xx: migrate platform to common led helper functions

Signed-off-by: Michael Heimpold <mhei@…>
Signed-off-by: Florian Fainelli <florian@…>

File:
1 edited

Legend:

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

    r26875 r35661  
    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/brcm63xx.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         [ -n "$status_led2" ] && { 
    18                 led_set_attr $status_led2 "trigger" "timer" 
    19                 led_set_attr $status_led2 "delay_on" "$1" 
    20                 led_set_attr $status_led2 "delay_off" "$2" 
    21         } 
    22 } 
    23  
    24 status_led_set_morse() { 
    25         led_set_attr $status_led "trigger" "morse" 
    26         led_set_attr $status_led "delay" "$1" 
    27         led_set_attr $status_led "message" "$2" 
    28         [ -n "$status_led2" ] && { 
    29                 led_set_attr $status_led2 "trigger" "morse" 
    30                 led_set_attr $status_led2 "delay" "$1" 
    31                 led_set_attr $status_led2 "message" "$2" 
    32         } 
    33 } 
    34  
    35 status_led_on() { 
    36         led_set_attr $status_led "trigger" "none" 
    37         led_set_attr $status_led "brightness" 255 
    38         [ -n "$status_led2" ] && { 
    39                 led_set_attr $status_led2 "trigger" "none" 
    40                 led_set_attr $status_led2 "brightness" 255 
    41         } 
    42 } 
    43  
    44 status_led_off() { 
    45         led_set_attr $status_led "trigger" "none" 
    46         led_set_attr $status_led "brightness" 0 
    47         [ -n "$status_led2" ] && { 
    48                 led_set_attr $status_led2 "trigger" "none" 
    49                 led_set_attr $status_led2 "brightness" 0 
    50         } 
    51 } 
    526 
    537set_state() { 
     
    559        preinit) 
    5610                insmod leds-gpio 
    57                 status_led_on 
    5811                status_led_set_timer 200 200 
    5912                ;; 
Note: See TracChangeset for help on using the changeset viewer.