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 | |
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')
-rw-r--r-- | recipes-bsp/multitech/mts-io.inc | 5 | ||||
-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 |
3 files changed, 21 insertions, 1 deletions
diff --git a/recipes-bsp/multitech/mts-io.inc b/recipes-bsp/multitech/mts-io.inc index 6d77e34..c9ee889 100644 --- a/recipes-bsp/multitech/mts-io.inc +++ b/recipes-bsp/multitech/mts-io.inc @@ -7,13 +7,14 @@ LIC_FILES_CHKSUM = "file://io-module/COPYING;md5=94d55d512a9ba36caa9b7df079bae19 file://io-tool/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ " DEPENDS = "virtual/kernel" -INC_PR = "r7" +INC_PR = "r8" SRCREV = "${PV}" SRC_URI = " \ git://git.multitech.net/mts-io.git;protocol=git \ file://led-status_heartbeat_trigger \ + file://lora-led-updater \ file://mts-io.init \ file://mts-io.mtp.init \ file://radio-reset.init \ @@ -46,6 +47,7 @@ FILES_${PN} = "${base_libdir}/modules/${KERNEL_VERSION}/extra/mts_io.ko" FILES_${PN} += "${sysconfdir}" FILES_${PN} += "${libdir}/mts-io-sysfs*" FILES_${PN} += "${sbindir}/mts-io-sysfs" +FILES_${PN}_append_mtp += "${sbindir}/lora-led-updater" INITSCRIPT_NAME = "mts-io" INITSCRIPT_PARAMS = "start 39 S ." @@ -88,6 +90,7 @@ fakeroot do_install () { fakeroot do_install_append_mtp() { # install MTP mts-io init script install -m 0755 ${WORKDIR}/mts-io.mtp.init ${D}${sysconfdir}/init.d/mts-io + install -m 0755 ${WORKDIR}/lora-led-updater ${D}${sbindir}/lora-led-updater # disable radio-reset for the mtp hardware sed -i 's/ENABLED="yes"/ENABLED="no"/g' ${D}${sysconfdir}/default/radio-reset 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) |