slitaz-arm rev 137
tazberry: add support for breakout boards
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Apr 26 11:11:16 2014 +0200 (2014-04-26) |
parents | 32e4a7121e8f |
children | e785c2b0ea5a |
files | rpi/tazberry |
line diff
1.1 --- a/rpi/tazberry Sat Apr 26 10:43:15 2014 +0200 1.2 +++ b/rpi/tazberry Sat Apr 26 11:11:16 2014 +0200 1.3 @@ -6,6 +6,7 @@ 1.4 # Author: Christophe Lincoln <pankso@slitaz.org> 1.5 # 1.6 . /lib/libtaz.sh 1.7 +check_root 1.8 1.9 title="{ TazBerry }" 1.10 config="/boot/config.txt" 1.11 @@ -290,6 +291,38 @@ 1.12 [ "$?" == 0 ] && echo reboot ##### 1.13 } 1.14 1.15 +# Breakout bords! 1.16 +boards_box() { 1.17 + dialog \ 1.18 + --clear \ 1.19 + --title "$title" \ 1.20 + --ok-label "Exec" \ 1.21 + --cancel-label "Quit" \ 1.22 + --menu "\nSetup or use a breakout board" ${height} ${width} 14 \ 1.23 +"cam-setup" "$(gettext 'Configure your Pi to use a Camera')" \ 1.24 +"piglow" "$(gettext 'Setup your Pi to use PiGlow')" 2>${tmp} 1.25 + 1.26 + # Handle options 1.27 + case "$?" in 1.28 + 1|255) rm -rf ${tmpdir} && exit 0 ;; 1.29 + esac 1.30 + 1.31 + # Handle actions 1.32 + action=$(cat $tmp) 1.33 + case "$action" in 1.34 + cam-setup) 1.35 + picam_setup ;; 1.36 + piglow) 1.37 + for pkg in python-rpi-pyglow wiringpi-piglow; do 1.38 + spk-add ${pkg} 1.39 + done 1.40 + newline 1.41 + echo -n "Do you wish to try the leds [y/N] ? " ; read anser 1.42 + [ "$anser" == "y" ] && echo "Enter a value between: 5-255" \ 1.43 + && pyglow test 1.44 + esac 1.45 +} 1.46 + 1.47 # Main Dialog menu 1.48 main_box() { 1.49 dialog \ 1.50 @@ -300,7 +333,7 @@ 1.51 --menu "" ${height} ${width} 14 \ 1.52 "rpi-stats" "$(gettext 'Show some RPi system stats')" \ 1.53 "gpu-mem" "$(gettext 'Set memory split between ARM and GPU')" \ 1.54 -"cam-setup" "$(gettext 'Configure your Pi to use the Camera')" \ 1.55 +"boards" "$(gettext 'Boards settings and tools (Camera, PyGlow)')" \ 1.56 "act-led" "$(gettext 'Test the RPi onboard ACT green led')" \ 1.57 "oclock" "$(gettext 'Overclocking configuration')" \ 1.58 "rpi-turbo" "$(gettext 'Enable or disable RPi turbo on next boot')" \ 1.59 @@ -324,8 +357,8 @@ 1.60 msg_box "RPi Stats" "$(rpi_stats)" ;; 1.61 gpu-mem) 1.62 gpu_mem_box ;; 1.63 - cam-setup) 1.64 - picam_setup ;; 1.65 + boards) 1.66 + boards_box ;; 1.67 act-led) 1.68 brightness="/sys/class/leds/led0/brightness" 1.69 (echo "1" > ${brightness}