#!/bin/bash # SPDX-License-Identifier: Apache-2.0 # Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius) . /etc/profile # Enable GPIO 77 for power LED manipulation echo ${DEVICE_LED} > /sys/class/gpio/export # Enable WIFI GPIO for WIFI manipulation echo ${DEVICE_WIFI} > /sys/class/gpio/export # Power up the WIFI device echo out > /sys/class/gpio/gpio${DEVICE_WIFI}/direction echo 1 > /sys/class/gpio/gpio${DEVICE_WIFI}/value # Enable PWM for rumble and turn rumble off during startup. echo 0 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/export echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle