diff options
author | Brandon Bayer <bbayer@multitech.com> | 2016-10-20 16:31:38 -0500 |
---|---|---|
committer | Brandon Bayer <bbayer@multitech.com> | 2016-10-20 17:06:37 -0500 |
commit | 211c660731c12266838981961e639f022e0d6ab8 (patch) | |
tree | 1dadcc3c1e8919b933062aaf0282decca4fa7cfa /recipes-bsp/multitech/mts-io | |
parent | 87928ccd1e165fa1c8142314d7f6403887f9f095 (diff) | |
download | meta-multitech-211c660731c12266838981961e639f022e0d6ab8.tar.gz meta-multitech-211c660731c12266838981961e639f022e0d6ab8.tar.bz2 meta-multitech-211c660731c12266838981961e639f022e0d6ab8.zip |
mtp:feat: light lora led if spidev0.0 is in use
Diffstat (limited to 'recipes-bsp/multitech/mts-io')
-rwxr-xr-x | recipes-bsp/multitech/mts-io/lora-led-updater | 12 | ||||
-rw-r--r-- | recipes-bsp/multitech/mts-io/mts-io.mtp.init | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/recipes-bsp/multitech/mts-io/lora-led-updater b/recipes-bsp/multitech/mts-io/lora-led-updater new file mode 100755 index 0000000..637ee2e --- /dev/null +++ b/recipes-bsp/multitech/mts-io/lora-led-updater @@ -0,0 +1,12 @@ +#!/bin/bash + +while true; do + fuser /dev/spidev0.0 > /dev/null + if [ $? == 0 ]; then + mts-io-sysfs store led-lora 1 + else + mts-io-sysfs store led-lora 0 + fi + sleep 5 +done + diff --git a/recipes-bsp/multitech/mts-io/mts-io.mtp.init b/recipes-bsp/multitech/mts-io/mts-io.mtp.init index 3ce08a9..b4aa489 100644 --- a/recipes-bsp/multitech/mts-io/mts-io.mtp.init +++ b/recipes-bsp/multitech/mts-io/mts-io.mtp.init @@ -21,6 +21,10 @@ cell_init() { mts-io-sysfs store radio-power 1 } +start_lora_led_updater() { + lora-led-updater & +} + case $1 in start) echo "Loading mts-io module" @@ -28,6 +32,7 @@ case $1 in lora_init eth_init cell_init & + start_lora_led_updater ;; stop) |