"Soft" reboot button

Add function to perform a "soft" reboot for quicker reboots.

Co-Authored-By: CHaucke89 <132518562+chaucke89@users.noreply.github.com>
This commit is contained in:
FrogAi
2024-02-27 16:34:47 -07:00
parent 506cbb87e8
commit 6907410750
9 changed files with 50 additions and 3 deletions

View File

@@ -134,6 +134,14 @@ class Tici(HardwareBase):
def reboot(self, reason=None):
subprocess.check_output(["sudo", "reboot"])
def soft_reboot(self):
# Reload the touchscreen driver to reset touch_count and avoid triggering a system reset prompt
sudo_write("894000.i2c", "/sys/bus/platform/drivers/i2c_geni/unbind")
time.sleep(0.5)
sudo_write("894000.i2c", "/sys/bus/platform/drivers/i2c_geni/bind")
time.sleep(0.5)
os.system("sudo systemctl restart comma")
def uninstall(self):
Path("/data/__system_reset__").touch()
os.sync()