2023-02-16 22:40:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Copyright (C) 2021-present Fewtarius (https://github.com/fewtarius)
|
|
|
|
|
|
|
|
. /etc/profile
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2023-06-02 20:58:46 +00:00
|
|
|
MYSLEEPMODE=$(get_setting system.suspendmode)
|
|
|
|
if [ -z "${MYSLEEPMODE}" ]
|
|
|
|
then
|
|
|
|
/usr/bin/setsuspendmode freeze
|
|
|
|
fi
|
|
|
|
|
2023-09-01 14:33:59 +00:00
|
|
|
echo s2idle >/sys/power/mem_sleep
|