diff --git a/selfdrive/car/car_helpers.py b/selfdrive/car/car_helpers.py index 61b776955..1e811f6ce 100644 --- a/selfdrive/car/car_helpers.py +++ b/selfdrive/car/car_helpers.py @@ -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 diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index bb98f1972..c137a3427 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -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 diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 1c42d5389..2b2d65d60 100644 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -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 diff --git a/selfdrive/thermald.py b/selfdrive/thermald.py index ddda0e9a4..93d7b4d38 100755 --- a/selfdrive/thermald.py +++ b/selfdrive/thermald.py @@ -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')