summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech/mts-io/lora-led-updater
blob: 0e383100b915a988eb4c3e68c4f431abdf3352b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

while true; do
  # If driver is unloaded, stop.
  [[ -d /sys/devices/platform/mts-io ]] || exit 0
  fuser /dev/spidev0.0 > /dev/null
  if [ $? == 0 ]; then
    mts-io-sysfs store led-lora 1 >/dev/null 2>&1
  else
    mts-io-sysfs store led-lora 0 >/dev/null 2>&1
  fi
  sleep 5
done