Merge branch 'devel-staging' of https://github.com/commaai/openpilot into devel

This commit is contained in:
dragonpilot
2020-02-21 12:05:35 +10:00
4 changed files with 10 additions and 4 deletions
+5
View File
@@ -199,6 +199,11 @@ def fingerprint(logcan, sendcan, has_relay):
car_fingerprint = fixed_fingerprint
source = car.CarParams.FingerprintSource.fixed
fixed_fingerprint = os.environ.get('FINGERPRINT', "")
if len(fixed_fingerprint):
car_fingerprint = fixed_fingerprint
source = car.CarParams.FingerprintSource.fixed
cloudlog.warning("fingerprinted %s", car_fingerprint)
return car_fingerprint, finger, vin, car_fw, source
+2 -1
View File
@@ -4,6 +4,7 @@ from selfdrive.car.interfaces import CarStateBase
from opendbc.can.parser import CANParser
from selfdrive.config import Conversions as CV
from selfdrive.car.toyota.values import CAR, DBC, STEER_THRESHOLD, TSS2_CAR, NO_DSU_CAR
from common.realtime import sec_since_boot
from common.params import Params
params = Params()
@@ -118,7 +119,7 @@ class CarState(CarStateBase):
def update(self, cp, cp_cam):
# dragonpilot, don't check for param too often as it's a kernel call
ts = sec_since_boot()
if ts - self.ts_last_check > 5.:
if ts - self.ts_last_check >= 5.:
self.dragon_toyota_stock_dsu = True if params.get("DragonToyotaStockDSU", encoding='utf8') == "1" else False
self.ts_last_check = ts
+1 -1
View File
@@ -381,7 +381,7 @@ class CarInterface(CarInterfaceBase):
def update(self, c, can_strings):
# dragonpilot, don't check for param too often as it's a kernel call
ts = sec_since_boot()
if ts - self.ts_last_check > 5.:
if ts - self.ts_last_check >= 5.:
self.dragon_enable_steering_on_signal = True if params.get("DragonEnableSteeringOnSignal", encoding='utf8') == "1" else False
self.dragon_allow_gas = True if params.get("DragonAllowGas", encoding='utf8') == "1" else False
self.dragon_toyota_stock_dsu = True if params.get("DragonToyotaStockDSU", encoding='utf8') == "1" else False
+2 -2
View File
@@ -412,14 +412,14 @@ def thermald_thread():
# dragonpilot
ts = sec_since_boot()
# update variable status every 10 secs
if ts_last_update_vars is None or ts - ts_last_update_vars > 10.:
if ts_last_update_vars is None or ts - ts_last_update_vars >= 10.:
dragon_charging_ctrl = True if params.get('DragonChargingCtrl', encoding='utf8') == "1" else False
dragon_charging_max = int(params.get('DragonCharging', encoding='utf8'))
dragon_discharging_min = int(params.get('DragonDisCharging', encoding='utf8'))
ts_last_update_vars = ts
# we update charging status once every min
if ts_last_charging_ctrl is None or ts - ts_last_charging_ctrl > 60.:
if ts_last_charging_ctrl is None or ts - ts_last_charging_ctrl >= 60.:
if dragon_charging_ctrl:
if msg.thermal.batteryPercent >= dragon_charging_max:
os.system('echo "0" > /sys/class/power_supply/battery/charging_enabled')