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 1547f8b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ COPY pktfwd/ "$PYTHON_APP_DIR"
COPY reset_lgw.sh "$RESET_LGW_FILEPATH"

# Copy sx1301 lora_pkt_fwd_SPI_BUS
# hadolint ignore=DL3022
COPY --from=nebraltd/packet_forwarder:4ae10d80892174ba8598cf98fbefd52721a2d59b "$SX1301_PACKET_FORWARDER_OUTPUT_DIR" "$SX1301_DIR"

# Copy sx1302 chip_id, reset_lgw, and lora_pkt_fwd
# hadolint ignore=DL3022
COPY --from=nebraltd/sx1302_hal:e8533b93e76c5a04075de8905ba0c7e93434776c "$SX1302_HAL_OUTPUT_DIR" "$SX1302_DIR"

# Copy pktfwd python app dependencies
Expand Down
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 1547f8b

Please sign in to comment.