diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/get_sid b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/get_sid new file mode 100644 index 0000000..b552a1c --- /dev/null +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/get_sid @@ -0,0 +1,2 @@ +#!/bin/sh +echo $(for i in 0 4 8 c; do devmem 0x01c2380$i 32; done) | sed 's/ \?0x//g' diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-led b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-led new file mode 100644 index 0000000..7e82ea2 --- /dev/null +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-led @@ -0,0 +1,26 @@ +#!/bin/sh + +if [ $# -ne 1 ];then + echo "ERROR LED ARGS" + exit; +fi +case ${1} in + 0) value=0x0a;; + 1) value=0x3a;; + *) echo "ERROR LED VALUE"; exit 1;; +esac + +# Load I2C modules +modprobe i2c-dev +modprobe i2c-mv64xxx + +# Turn on/off the LED +i2cset -y 0 0x34 0x32 ${value} +if [ $? -ne 0 ]; then + echo "ERROR LED I2C" +else + echo "OK" +fi + +# Unload I2C modules +modprobe -r i2c_mv64xxx i2c_dev >/dev/null 2>&1 diff --git a/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-speaker b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-speaker new file mode 100644 index 0000000..306b300 --- /dev/null +++ b/FunKey/board/funkey/rootfs-overlay/usr/local/sbin/test-speaker @@ -0,0 +1,24 @@ +#!/bin/sh + +# Turn on Power Amplifier +gpioset $(gpiofind "PA")=1 +if [ $? -ne 0 ]; then + echo "ERROR SPEAKER ON" +else + + # Play 1kHz sine wave + speaker-test -t sine -s 1 -f 1000 >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "ERROR SPEAKER SINE" + gpioset $(gpiofind "PA")=0 + else + + # Turn off Power Amplifier + gpioset $(gpiofind "PA")=0 + if [ $? -ne 0 ]; then + echo "ERROR SPEAKER OFF" + else + echo "OK" + fi + fi +fi