Power saving refactor (#389)

* Exit power saving also for CAN based ingition detection and replace interrup with simple state machine. a bit of delay it's fine

* bug fixes and also CDP set on start

* sorry misra

* move comment

* typo

* remove ignition interrupts

* Power saving state machine should be done by boardd, which also sets safety modes and usb power modes

* typo

* Added usb command for power save state setting

* Added power save enabled packet

* Added power_save_enabled to python lib too
This commit is contained in:
rbiasini
2019-11-21 12:53:00 -08:00
committed by GitHub
parent d58d08fbbf
commit 1192d934a0
4 changed files with 26 additions and 79 deletions

View File

@@ -347,7 +347,7 @@ class Panda(object):
def health(self):
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 28)
a = struct.unpack("IIIIIBBBBBBBB", dat)
a = struct.unpack("IIIIIBBBBBBBBB", dat)
return {
"voltage": a[0],
"current": a[1],
@@ -361,7 +361,8 @@ class Panda(object):
"car_harness_status": a[9],
"usb_power_mode": a[10],
"safety_mode": a[11],
"fault_status": a[12]
"fault_status": a[12],
"power_save_enabled": a[13]
}
# ******************* control *******************