diff options
author | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2021-03-14 11:56:13 +0200 |
---|---|---|
committer | Andrii Pientsov <andrii.pientsov@globallogic.com> | 2021-03-14 15:50:35 +0200 |
commit | 51ea84f8c4ce07e0c1206568ae7e29a2a0a28f55 (patch) | |
tree | 5a9d5d07bbec6a0be5e3d2cb1e768daab49c6bba /recipes-bsp/multitech/mtre-leds/mtre-leds-monitor.sh | |
parent | 24fff730a2f90e90b390ec317a1ca650401d748d (diff) | |
parent | 81f0751c9d15d969ebb568c67b7903d2d5e49a0d (diff) | |
download | meta-multitech-atmel-51ea84f8c4ce07e0c1206568ae7e29a2a0a28f55.tar.gz meta-multitech-atmel-51ea84f8c4ce07e0c1206568ae7e29a2a0a28f55.tar.bz2 meta-multitech-atmel-51ea84f8c4ce07e0c1206568ae7e29a2a0a28f55.zip |
Merge branch 'mtre-thud' into mtre-dunfell
Diffstat (limited to 'recipes-bsp/multitech/mtre-leds/mtre-leds-monitor.sh')
-rwxr-xr-x | recipes-bsp/multitech/mtre-leds/mtre-leds-monitor.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mtre-leds/mtre-leds-monitor.sh b/recipes-bsp/multitech/mtre-leds/mtre-leds-monitor.sh new file mode 100755 index 0000000..087d8f3 --- /dev/null +++ b/recipes-bsp/multitech/mtre-leds/mtre-leds-monitor.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +gpio=/sys/devices/platform/mts-io/reset +#gpio=/tmp/pb + +status="0" + +while : +do + usleep 150000 + if [[ -r "$gpio" ]]; then + read -n 1 val < $gpio + if [[ ! -z "$val" && "$val" != "$status" ]]; then + if [[ "$val" == "1" ]]; then + mtre-leds start-test + status=$val + elif [[ "$val" == "0" ]]; then + mtre-leds stop-test + status=$val + fi + fi + fi +done |