From 067f1bfe9e935b9318becdb0479d56bfd225392f Mon Sep 17 00:00:00 2001 From: rbiasini Date: Sun, 16 Dec 2018 19:54:29 -0700 Subject: [PATCH] hotfix: wait longer in CDP mode before switching to fast charge, so EON can boot (#469) --- panda/VERSION | 2 +- panda/board/main.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/panda/VERSION b/panda/VERSION index 301779b03e..02e8c95da5 100644 --- a/panda/VERSION +++ b/panda/VERSION @@ -1 +1 @@ -v1.1.7 \ No newline at end of file +v1.1.8 \ No newline at end of file diff --git a/panda/board/main.c b/panda/board/main.c index 8bb6a0cee0..b1033bb732 100644 --- a/panda/board/main.c +++ b/panda/board/main.c @@ -589,6 +589,8 @@ int main() { uint64_t marker = 0; #define CURRENT_THRESHOLD 0xF00 #define CLICKS 8 + // Enough clicks to ensure that enumeration happened. Should be longer than bootup time of the device connected to EON + #define CLICKS_BOOTUP 30 #endif for (cnt=0;;cnt++) { @@ -615,8 +617,8 @@ int main() { } break; case USB_POWER_CDP: - // been CLICKS clicks since we switched to CDP - if ((cnt-marker) >= CLICKS) { + // been CLICKS_BOOTUP clicks since we switched to CDP + if ((cnt-marker) >= CLICKS_BOOTUP ) { // measure current draw, if positive and no enumeration, switch to DCP if (!is_enumerated && current < CURRENT_THRESHOLD) { puts("USBP: no enumeration with current draw, switching to DCP mode\n");