slitaz-arm rev 167
Mv ACT led on/off from tazberry to pileds
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sun May 04 19:17:48 2014 +0200 (2014-05-04) |
parents | 0eb0f35e2f0d |
children | 9b1e4f9cf134 |
files | rpi/pileds rpi/tazberry |
line diff
1.1 --- a/rpi/pileds Sun May 04 19:10:58 2014 +0200 1.2 +++ b/rpi/pileds Sun May 04 19:17:48 2014 +0200 1.3 @@ -9,14 +9,12 @@ 1.4 usage() { 1.5 cat << EOT 1.6 1.7 -$(boldify "Usage:") $(basename $0) [ledtype] [--option] 1.8 +$(boldify "Usage:") $(basename $0) [command] 1.9 1.10 -$(boldify "Types:") 1.11 +$(boldify "Commands:") 1.12 act Turn on/off the on board ACT green led 1.13 7-clock Adafruit 7-segment LED Backpack clock example 1.14 - ada-clean Clean: Adafruit 7-segment or 8x8 Matrix 1.15 - 1.16 -$(boldify "Types:") 1.17 + ada-clean Clean: Adafruit 7-segment or 8x8 Matrix 1.18 1.19 EOT 1.20 #8x8 Adafruit 8x8 LED Matrix Backpack example 1.21 @@ -40,7 +38,13 @@ 1.22 1.23 case "$1" in 1.24 1.25 - act) ;; 1.26 + act) 1.27 + status="$(cat /sys/class/leds/led0/brightness)" 1.28 + if [ "$status" == 0 ]; then 1.29 + echo "1" > ${brightness} 1.30 + else 1.31 + echo "0" > ${brightness} 1.32 + fi ;; 1.33 1.34 7-clock) 1.35 scripts="/usr/share/adafruit/LEDBackpack"
2.1 --- a/rpi/tazberry Sun May 04 19:10:58 2014 +0200 2.2 +++ b/rpi/tazberry Sun May 04 19:17:48 2014 +0200 2.3 @@ -403,7 +403,7 @@ 2.4 "rpi-stats" "$(gettext 'Show some RPi system stats')" \ 2.5 "gpu-mem" "$(gettext 'Set memory split between ARM and GPU')" \ 2.6 "boards" "$(gettext 'Boards settings and tools (Camera, PyGlow)')" \ 2.7 -"act-led" "$(gettext 'Test the RPi onboard ACT green led')" \ 2.8 +"act-led" "$(gettext 'Turn on/off RPi onboard ACT green led')" \ 2.9 "oclock" "$(gettext 'Overclocking configuration')" \ 2.10 "rpi-turbo" "$(gettext 'Enable or disable RPi turbo on next boot')" \ 2.11 "boot-cmdline" "$(gettext 'View boot args /boot/cmdline.txt')" \ 2.12 @@ -426,13 +426,11 @@ 2.13 rpi-stats) 2.14 msg_box "RPi Stats" "$(rpi_stats)" ;; 2.15 gpu-mem) 2.16 - gpu_mem_box ;; 2.17 + gpu_mem_box ;; 2.18 boards) 2.19 - boards_box ;; 2.20 - act-led) 2.21 - brightness="/sys/class/leds/led0/brightness" 2.22 - (echo "1" > ${brightness} 2.23 - sleep 3; echo "0" > ${brightness}) & ;; 2.24 + boards_box ;; 2.25 + act-led) 2.26 + pileds act ;; 2.27 oclock) 2.28 oclock_box ;; 2.29 rpi-turbo)