Skip to content

Commit

Permalink
fix: shellcheck and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinmarnold committed Oct 22, 2021
1 parent 4ff56f9 commit 56fb81c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions reset_lgw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# This script is intended to be used on all sx130x platforms. It performs
# the following actions:
# - export/unpexort GPIO pin $CONCENTRATOR_RESET_PIN used to reset the SX130x chip and to enable the LDOs
# - export/unpexort GPIO pin ${CONCENTRATOR_RESET_PIN} used to reset the SX130x chip and to enable the LDOs
# - can also be used to reset other functions like the optional SX1261 radio used for LBT/Spectral Scan, SX1302 power enable,
# or AD5338R reset, by changing the value of CONCENTRATOR_RESET_PIN
#
Expand Down Expand Up @@ -30,24 +30,24 @@ WAIT_GPIO() {

init() {
# setup GPIOs
echo "$CONCENTRATOR_RESET_PIN" > /sys/class/gpio/export; WAIT_GPIO
echo "${CONCENTRATOR_RESET_PIN}" > /sys/class/gpio/export; WAIT_GPIO

# set GPIOs as output
echo "out" > /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN/direction; WAIT_GPIO
echo "out" > "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}/direction"; WAIT_GPIO
}

reset() {
echo "CoreCell reset through GPIO$CONCENTRATOR_RESET_PIN..."
echo "CoreCell reset through GPIO${CONCENTRATOR_RESET_PIN}..."

echo "1" > /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN/value; WAIT_GPIO
echo "0" > /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN/value; WAIT_GPIO
echo "1" > "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}/value"; WAIT_GPIO
echo "0" > "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}/value"; WAIT_GPIO
}

term() {
# cleanup all GPIOs
if [ -d /sys/class/gpio/gpio$CONCENTRATOR_RESET_PIN ]
if [ -d "/sys/class/gpio/gpio${CONCENTRATOR_RESET_PIN}" ]
then
echo "$CONCENTRATOR_RESET_PIN" > /sys/class/gpio/unexport; WAIT_GPIO
echo "${CONCENTRATOR_RESET_PIN}" > /sys/class/gpio/unexport; WAIT_GPIO
fi
}

Expand Down

0 comments on commit 56fb81c

Please sign in to comment.