Neu hinzugefügt: - tools/superx-ctrl.py — zentrale CLI-Steuerung (Frostbay + Tablet RGB + EC Turbo) - tools/tablet-rgb.py — Tablet RGB via HIDRAW - tools/ec-read.py — EC Turbo Status Reader - tools/turbo-*.py — 7 Turbo-Debug/Listener-Scripts - tools/patch-hhd-superx.py — HHD Patch für Super X Turbo-Bypass - udev/99-superx-hid.rules — HIDRAW-Zugriffsregel (0x1A86:0x1305) - dms/plugins/SuperXCtrl/ — DMS Widget (plugin.json + QML + Settings) - README.md — vollständig überarbeitet mit Architektur, Nutzung, Verzeichnisstruktur Geändert: - tools/frostbay_ble.py — rgb-brightness Subcommand hinzugefügt (0xFD Mode)
42 lines
No EOL
1 KiB
Python
Executable file
42 lines
No EOL
1 KiB
Python
Executable file
#!/usr/bin/env python3
|
|
"""EC Turbo Reader — Liest EC RAM. Wird via sudo ausgeführt."""
|
|
import os, struct, json, sys, time
|
|
|
|
EC_DEV = "/sys/kernel/debug/ec/ec0/io"
|
|
|
|
def read_ec():
|
|
with open(EC_DEV, "rb") as f:
|
|
data = f.read()
|
|
return data
|
|
|
|
def get_turbo(data):
|
|
b30 = data[0x30] # Turbo Status
|
|
fan1 = data[0x31]
|
|
fan2 = data[0x32]
|
|
pump = data[0x33]
|
|
|
|
turbo_map = {
|
|
0: "off",
|
|
6: "turbo",
|
|
}
|
|
|
|
return {
|
|
"turbo": b30 > 0,
|
|
"turbo_status": b30,
|
|
"turbo_label": turbo_map.get(b30, f"mode_{b30}"),
|
|
"fan1_pwm": fan1,
|
|
"fan2_pwm": fan2,
|
|
"pump_pwm": pump,
|
|
}
|
|
|
|
if __name__ == "__main__":
|
|
if len(sys.argv) > 1 and sys.argv[1] == "watch":
|
|
prev = None
|
|
while True:
|
|
status = get_turbo(read_ec())
|
|
if status != prev:
|
|
print(json.dumps(status), flush=True)
|
|
prev = status
|
|
time.sleep(0.5)
|
|
else:
|
|
print(json.dumps(get_turbo(read_ec()))) |