mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-02 06:03:43 +08:00
Revert ""Soft" reboot button"
This reverts commit d48819df05f43368b0fe043de4154df990008bcd.
This commit is contained in:
@@ -26,7 +26,6 @@ public:
|
||||
}
|
||||
|
||||
static void reboot() {}
|
||||
static void soft_reboot() {}
|
||||
static void poweroff() {}
|
||||
static void set_brightness(int percent) {}
|
||||
static void set_display_power(bool on) {}
|
||||
|
||||
@@ -30,10 +30,6 @@ class HardwareBase(ABC):
|
||||
def reboot(self, reason=None):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def soft_reboot(self):
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def uninstall(self):
|
||||
pass
|
||||
|
||||
@@ -19,9 +19,6 @@ class Pc(HardwareBase):
|
||||
|
||||
def reboot(self, reason=None):
|
||||
print("REBOOT!")
|
||||
|
||||
def soft_reboot(self):
|
||||
print("SOFT REBOOT!")
|
||||
|
||||
def uninstall(self):
|
||||
print("uninstall")
|
||||
|
||||
@@ -50,13 +50,6 @@ public:
|
||||
}
|
||||
|
||||
static void reboot() { std::system("sudo reboot"); }
|
||||
static void soft_reboot() {
|
||||
std::system("echo 894000.i2c | sudo tee /sys/bus/platform/drivers/i2c_geni/unbind");
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
std::system("echo 894000.i2c | sudo tee /sys/bus/platform/drivers/i2c_geni/bind");
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
std::system("sudo systemctl restart comma");
|
||||
}
|
||||
static void poweroff() { std::system("sudo poweroff"); }
|
||||
static void set_brightness(int percent) {
|
||||
std::string max = util::read_file("/sys/class/backlight/panel0-backlight/max_brightness");
|
||||
|
||||
@@ -134,14 +134,6 @@ 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