Compiled on Mar.26,2024

This commit is contained in:
Comma Device
2024-03-26 00:38:02 +00:00
parent 71d02f3610
commit d4a16fc37f
175 changed files with 16736 additions and 16559 deletions
Binary file not shown.
+1
View File
@@ -26,6 +26,7 @@ public:
}
static void reboot() {}
static void soft_reboot() {}
static void poweroff() {}
static void set_brightness(int percent) {}
static void set_display_power(bool on) {}
+4
View File
@@ -30,6 +30,10 @@ class HardwareBase(ABC):
def reboot(self, reason=None):
pass
@abstractmethod
def soft_reboot(self):
pass
@abstractmethod
def uninstall(self):
pass
+3
View File
@@ -19,6 +19,9 @@ class Pc(HardwareBase):
def reboot(self, reason=None):
print("REBOOT!")
def soft_reboot(self):
print("SOFT REBOOT!")
def uninstall(self):
print("uninstall")
+7
View File
@@ -50,6 +50,13 @@ 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");
+8
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()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.