From 22556b1ddfc0e4b5c71406ce78668f99ebed4c67 Mon Sep 17 00:00:00 2001 From: Robbe Derks Date: Mon, 3 May 2021 14:59:36 +0200 Subject: [PATCH] fix health in python --- board/main.c | 1 + python/__init__.py | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/board/main.c b/board/main.c index 9b80830..3b53b09 100644 --- a/board/main.c +++ b/board/main.c @@ -42,6 +42,7 @@ 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 { uint32_t uptime_pkt; uint32_t voltage_pkt; diff --git a/python/__init__.py b/python/__init__.py index 13d543f..cebd9a5 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -332,8 +332,8 @@ class Panda(object): # ******************* health ******************* def health(self): - dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 41) - a = struct.unpack("IIIIIIIIBBBBBBBBB", dat) + dat = self._handle.controlRead(Panda.REQUEST_IN, 0xd2, 0, 0, 43) + a = struct.unpack("