dragonpilot beta3

date: 2023-08-22T14:21:17
commit: 6148ce3d77530281f890970718e9c42b2acc5ff1
This commit is contained in:
dragonpilot
2023-08-22 14:20:25 -07:00
parent 957d61c2f7
commit d8e5331c6e
722 changed files with 24317 additions and 116310 deletions
+12 -8
View File
@@ -83,6 +83,17 @@ def affine_irq(val, action):
for i in irqs:
sudo_write(str(val), f"/proc/irq/{i}/smp_affinity_list")
@lru_cache
def get_device_type():
# lru_cache and cache can cause memory leaks when used in classes
with open("/sys/firmware/devicetree/base/model") as f:
model = f.read().strip('\x00')
model = model.split('comma ')[-1]
# TODO: remove this with AGNOS 7+
if model.startswith('Qualcomm'):
model = 'tici'
return model
class Tici(HardwareBase):
@cached_property
def bus(self):
@@ -105,15 +116,8 @@ class Tici(HardwareBase):
with open("/VERSION") as f:
return f.read().strip()
@lru_cache
def get_device_type(self):
with open("/sys/firmware/devicetree/base/model") as f:
model = f.read().strip('\x00')
model = model.split('comma ')[-1]
# TODO: remove this with AGNOS 7+
if model.startswith('Qualcomm'):
model = 'tici'
return model
return get_device_type()
def get_sound_card_online(self):
if os.path.isfile('/proc/asound/card0/state'):