"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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user