distribution/packages/jelos/sources/autostart/RG351P/001-hardwareinit

17 lines
717 B
Text
Raw Normal View History

. /etc/profile
2022-02-05 14:23:32 +00:00
# Enable GPIO 77 for power LED manipulation
echo ${DEVICE_LED} > /sys/class/gpio/export 2>/dev/null
# Enable WIFI GPIO for WIFI manipulation
echo ${DEVICE_WIFI} > /sys/class/gpio/export 2>/dev/null
# Power up the WIFI device
echo out > /sys/class/gpio/gpio${DEVICE_WIFI}/direction 2>/dev/null
echo 1 > /sys/class/gpio/gpio${DEVICE_WIFI}/value 2>/dev/null
# Enable PWM for rumble and turn rumble off during startup.
echo 0 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/export 2>/dev/null
echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/period 2>/dev/null
echo 1 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/enable 2>/dev/null
echo 1000000 > /sys/class/pwm/${DEVICE_PWM_MOTOR}/pwm0/duty_cycle 2>/dev/null