mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-07-15 18:02:05 +08:00
延遲 params check 至3秒以減少 kernel calls
This commit is contained in:
@@ -369,7 +369,7 @@ class CarInterface(object):
|
||||
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 > 1.:
|
||||
if ts - self.ts_last_check > 3.:
|
||||
self.dragon_enable_steering_on_signal = False if params.get("DragonEnableSteeringOnSignal") == "0" else True
|
||||
self.dragon_allow_gas = False if params.get("DragonAllowGas") == "0" else True
|
||||
self.ts_last_check = ts
|
||||
|
||||
@@ -119,7 +119,7 @@ class CarState(object):
|
||||
def update(self, cp):
|
||||
# dragonpilot, don't check for param too often as it's a kernel call
|
||||
ts = sec_since_boot()
|
||||
if ts - self.ts_last_check > 1.:
|
||||
if ts - self.ts_last_check > 3.:
|
||||
self.dragon_toyota_stock_dsu = False if params.get("DragonToyotaStockDSU") == "0" else True
|
||||
self.ts_last_check = ts
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ class CarInterface(object):
|
||||
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 > 1.:
|
||||
if ts - self.ts_last_check > 3.:
|
||||
self.dragon_enable_steering_on_signal = False if params.get("DragonEnableSteeringOnSignal") == "0" else True
|
||||
self.dragon_allow_gas = False if params.get("DragonAllowGas") == "0" else True
|
||||
self.dragon_toyota_stock_dsu = False if params.get("DragonToyotaStockDSU") == "0" else True
|
||||
|
||||
@@ -509,7 +509,7 @@ def controlsd_thread(gctx=None):
|
||||
while True:
|
||||
# dragonpilot, don't check for param too often as it's a kernel call
|
||||
ts = sec_since_boot()
|
||||
if ts - ts_last_check > 1.:
|
||||
if ts - ts_last_check > 3.:
|
||||
dragon_toyota_stock_dsu = False if params.get("DragonToyotaStockDSU") == "0" else True
|
||||
ts_last_check = ts
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@ class DriverStatus():
|
||||
|
||||
# don't check for param too often as it's a kernel call
|
||||
ts = sec_since_boot()
|
||||
if ts - self.ts_last_check > 1.:
|
||||
if ts - self.ts_last_check > 3.:
|
||||
self.monitor_param_on = params.get("IsDriverMonitoringEnabled") == "1"
|
||||
self.ts_last_check = ts
|
||||
|
||||
@@ -169,7 +169,7 @@ class DriverStatus():
|
||||
|
||||
# don't check for param too often as it's a kernel call
|
||||
ts = sec_since_boot()
|
||||
if ts - self.dp_last_check > 1.:
|
||||
if ts - self.dp_last_check > 3.:
|
||||
self.dragon_enable_driver_safety_check = False if params.get("DragonEnableDriverSafetyCheck") == "0" else True
|
||||
self.dp_last_check = ts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user