mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-01 03:43:46 +08:00
openpilot v0.8.11 release
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
// no-op base hw class
|
||||
class HardwareNone {
|
||||
public:
|
||||
static constexpr float MAX_VOLUME = 0;
|
||||
static constexpr float MIN_VOLUME = 0;
|
||||
static constexpr float MAX_VOLUME = 0.7;
|
||||
static constexpr float MIN_VOLUME = 0.2;
|
||||
|
||||
static std::string get_os_version() { return ""; }
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from abc import abstractmethod
|
||||
from collections import namedtuple
|
||||
|
||||
ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'ambient'])
|
||||
ThermalConfig = namedtuple('ThermalConfig', ['cpu', 'gpu', 'mem', 'bat', 'ambient', 'pmic'])
|
||||
|
||||
class HardwareBase:
|
||||
@staticmethod
|
||||
|
||||
@@ -369,7 +369,7 @@ class Android(HardwareBase):
|
||||
os.system('LD_LIBRARY_PATH="" svc power shutdown')
|
||||
|
||||
def get_thermal_config(self):
|
||||
return ThermalConfig(cpu=((5, 7, 10, 12), 10), gpu=((16,), 10), mem=(2, 10), bat=(29, 1000), ambient=(25, 1))
|
||||
return ThermalConfig(cpu=((5, 7, 10, 12), 10), gpu=((16,), 10), mem=(2, 10), bat=(29, 1000), ambient=(25, 1), pmic=((22,), 1000))
|
||||
|
||||
def set_screen_brightness(self, percentage):
|
||||
with open("/sys/class/leds/lcd-backlight/brightness", "w") as f:
|
||||
|
||||
@@ -78,7 +78,7 @@ class Pc(HardwareBase):
|
||||
print("SHUTDOWN!")
|
||||
|
||||
def get_thermal_config(self):
|
||||
return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), ambient=(None, 1))
|
||||
return ThermalConfig(cpu=((None,), 1), gpu=((None,), 1), mem=(None, 1), bat=(None, 1), ambient=(None, 1), pmic=((None,), 1))
|
||||
|
||||
def set_screen_brightness(self, percentage):
|
||||
pass
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import json
|
||||
import math
|
||||
import os
|
||||
import subprocess
|
||||
from functools import cached_property
|
||||
from enum import IntEnum
|
||||
from functools import cached_property
|
||||
from pathlib import Path
|
||||
|
||||
from cereal import log
|
||||
from selfdrive.hardware.base import HardwareBase, ThermalConfig
|
||||
from selfdrive.hardware.tici.amplifier import Amplifier
|
||||
from selfdrive.hardware.tici import iwlist
|
||||
from selfdrive.hardware.tici.amplifier import Amplifier
|
||||
|
||||
NM = 'org.freedesktop.NetworkManager'
|
||||
NM_CON_ACT = NM + '.Connection.Active'
|
||||
@@ -158,8 +159,8 @@ class Tici(HardwareBase):
|
||||
def get_network_info(self):
|
||||
modem = self.get_modem()
|
||||
try:
|
||||
info = modem.Command("AT+QNWINFO", int(TIMEOUT * 1000), dbus_interface=MM_MODEM, timeout=TIMEOUT)
|
||||
extra = modem.Command('AT+QENG="servingcell"', int(TIMEOUT * 1000), dbus_interface=MM_MODEM, timeout=TIMEOUT)
|
||||
info = modem.Command("AT+QNWINFO", math.ceil(TIMEOUT), dbus_interface=MM_MODEM, timeout=TIMEOUT)
|
||||
extra = modem.Command('AT+QENG="servingcell"', math.ceil(TIMEOUT), dbus_interface=MM_MODEM, timeout=TIMEOUT)
|
||||
state = modem.Get(MM_MODEM, 'State', dbus_interface=DBUS_PROPS, timeout=TIMEOUT)
|
||||
except Exception:
|
||||
return None
|
||||
@@ -225,10 +226,10 @@ class Tici(HardwareBase):
|
||||
return None
|
||||
|
||||
def get_modem_temperatures(self):
|
||||
modem = self.get_modem()
|
||||
timeout = 0.2 # Default timeout is too short
|
||||
try:
|
||||
command_timeout = 0.2
|
||||
temps = modem.Command("AT+QTEMP", int(command_timeout * 1000), dbus_interface=MM_MODEM, timeout=command_timeout)
|
||||
modem = self.get_modem()
|
||||
temps = modem.Command("AT+QTEMP", math.ceil(timeout), dbus_interface=MM_MODEM, timeout=timeout)
|
||||
return list(map(int, temps.split(' ')[1].split(',')))
|
||||
except Exception:
|
||||
return []
|
||||
@@ -274,7 +275,7 @@ class Tici(HardwareBase):
|
||||
os.system("sudo poweroff")
|
||||
|
||||
def get_thermal_config(self):
|
||||
return ThermalConfig(cpu=((1, 2, 3, 4, 5, 6, 7, 8), 1000), gpu=((48,49), 1000), mem=(15, 1000), bat=(None, 1), ambient=(65, 1000))
|
||||
return ThermalConfig(cpu=((1, 2, 3, 4, 5, 6, 7, 8), 1000), gpu=((48,49), 1000), mem=(15, 1000), bat=(None, 1), ambient=(65, 1000), pmic=((35, 36), 1000))
|
||||
|
||||
def set_screen_brightness(self, percentage):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user