controlsd: check all_valid only if not initialized (#23437)
* check all valid in if statement * apply reviewlocal_plotjuggler
parent
2d08f8b318
commit
67af095692
|
@ -366,12 +366,13 @@ class Controls:
|
|||
|
||||
self.sm.update(0)
|
||||
|
||||
all_valid = CS.canValid and self.sm.all_alive_and_valid()
|
||||
if not self.initialized and (all_valid or self.sm.frame * DT_CTRL > 3.5 or SIMULATION):
|
||||
if not self.read_only:
|
||||
self.CI.init(self.CP, self.can_sock, self.pm.sock['sendcan'])
|
||||
self.initialized = True
|
||||
Params().put_bool("ControlsReady", True)
|
||||
if not self.initialized:
|
||||
all_valid = CS.canValid and self.sm.all_alive_and_valid()
|
||||
if all_valid or self.sm.frame * DT_CTRL > 3.5 or SIMULATION:
|
||||
if not self.read_only:
|
||||
self.CI.init(self.CP, self.can_sock, self.pm.sock['sendcan'])
|
||||
self.initialized = True
|
||||
Params().put_bool("ControlsReady", True)
|
||||
|
||||
# Check for CAN timeout
|
||||
if not can_strs:
|
||||
|
|
Loading…
Reference in New Issue