fix health in python
parent
9a82ba3892
commit
22556b1ddf
|
@ -42,6 +42,7 @@
|
||||||
|
|
||||||
extern int _app_start[0xc000]; // Only first 3 sectors of size 0x4000 are used
|
extern int _app_start[0xc000]; // Only first 3 sectors of size 0x4000 are used
|
||||||
|
|
||||||
|
// When changing this struct, boardd and python/__init__.py needs to be kept up to date!
|
||||||
struct __attribute__((packed)) health_t {
|
struct __attribute__((packed)) health_t {
|
||||||
uint32_t uptime_pkt;
|
uint32_t uptime_pkt;
|
||||||
uint32_t voltage_pkt;
|
uint32_t voltage_pkt;
|
||||||
|
|
|
@ -332,8 +332,8 @@ class Panda(object):
|
||||||
# ******************* health *******************
|
# ******************* health *******************
|
||||||
|
|
||||||
def health(self):
|
def health(self):
|
||||||
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 41)
|
dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 43)
|
||||||
a = struct.unpack("IIIIIIIIBBBBBBBBB", dat)
|
a = struct.unpack("<IIIIIIIIBBBBBBBHBB", dat)
|
||||||
return {
|
return {
|
||||||
"uptime": a[0],
|
"uptime": a[0],
|
||||||
"voltage": a[1],
|
"voltage": a[1],
|
||||||
|
@ -350,8 +350,9 @@ class Panda(object):
|
||||||
"car_harness_status": a[12],
|
"car_harness_status": a[12],
|
||||||
"usb_power_mode": a[13],
|
"usb_power_mode": a[13],
|
||||||
"safety_mode": a[14],
|
"safety_mode": a[14],
|
||||||
"fault_status": a[15],
|
"safety_param": a[15],
|
||||||
"power_save_enabled": a[16]
|
"fault_status": a[16],
|
||||||
|
"power_save_enabled": a[17]
|
||||||
}
|
}
|
||||||
|
|
||||||
# ******************* control *******************
|
# ******************* control *******************
|
||||||
|
|
Loading…
Reference in New Issue