From 20c76ad592d0c633c078813db11d9b01316165b2 Mon Sep 17 00:00:00 2001 From: Nigel Armstrong Date: Wed, 13 Mar 2019 20:58:00 -0700 Subject: [PATCH] Power Saving (#169) * Only turn on wifi if not eon * Make sure esp is disabled on eon * Dont disable ESP in early --- board/gpio.h | 1 + board/main.c | 3 +++ python/__init__.py | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/board/gpio.h b/board/gpio.h index 6112f6f887c703..7bd24ecbb7c32d 100644 --- a/board/gpio.h +++ b/board/gpio.h @@ -454,6 +454,7 @@ void early() { #ifdef PANDA // enable the ESP, disable ESP boot mode // unless we are on a giant panda, then there's no ESP + // dont disable on grey panda if (is_giant_panda) { set_esp_mode(ESP_DISABLED); } else { diff --git a/board/main.c b/board/main.c index a8a0674c2a8f61..8ee1bb0c8c830c 100644 --- a/board/main.c +++ b/board/main.c @@ -539,6 +539,9 @@ int main() { } else { // enable ESP uart uart_init(USART1, 115200); + #ifdef EON + set_esp_mode(ESP_DISABLED); + #endif } // enable LIN uart_init(UART5, 10400); diff --git a/python/__init__.py b/python/__init__.py index b0364c20fbab19..b3610e6c3f9970 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -250,6 +250,7 @@ def flash_static(handle, code): pass def flash(self, fn=None, code=None, reconnect=True): + print("flash: main version is " + self.get_version()) if not self.bootstub: self.reset(enter_bootstub=True) assert(self.bootstub) @@ -270,7 +271,7 @@ def flash(self, fn=None, code=None, reconnect=True): code = f.read() # get version - print("flash: version is " + self.get_version()) + print("flash: bootstub version is " + self.get_version()) # do flash Panda.flash_static(self._handle, code)