From fcd064345aae0f3c88aa508d318136a3e47c41e2 Mon Sep 17 00:00:00 2001 From: Greg Hogan Date: Thu, 23 Sep 2021 23:12:36 -0700 Subject: [PATCH] python: disable power save by default when setting safety mode (#725) * python: disable power save by default when setting safety mode * no need to set power save manually * Update python/__init__.py Co-authored-by: Adeeb Shihadeh --- examples/query_fw_versions.py | 1 - python/__init__.py | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/query_fw_versions.py b/examples/query_fw_versions.py index aaf54f41a..4132959be 100755 --- a/examples/query_fw_versions.py +++ b/examples/query_fw_versions.py @@ -31,7 +31,6 @@ if __name__ == "__main__": uds_data_ids[uds_id] = "IDENTIFICATION_OPTION_SYSTEM_SUPPLIER_SPECIFIC" panda = Panda() - panda.set_power_save(0) panda.set_safety_mode(Panda.SAFETY_ELM327) print("querying addresses ...") with tqdm(addrs) as t: diff --git a/python/__init__.py b/python/__init__.py index 8fe515cc5..be9ef492d 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -453,10 +453,11 @@ class Panda(object): self._handle.controlWrite(Panda.REQUEST_OUT, 0xda, int(bootmode), 0, b'') time.sleep(0.2) - def set_safety_mode(self, mode=SAFETY_SILENT, disable_heartbeat=True): + def set_safety_mode(self, mode=SAFETY_SILENT, disable_checks=True): self._handle.controlWrite(Panda.REQUEST_OUT, 0xdc, mode, 0, b'') - if disable_heartbeat: + if disable_checks: self.set_heartbeat_disabled() + self.set_power_save(0) def set_can_forwarding(self, from_bus, to_bus): # TODO: This feature may not work correctly with saturated buses