Skip to content

Commit

Permalink
hotfix: wait longer in CDP mode before switching to fast charge, so E…
Browse files Browse the repository at this point in the history
…ON can boot (#469)
  • Loading branch information
rbiasini committed Dec 17, 2018
1 parent e3c934b commit 067f1bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion panda/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.1.7
v1.1.8
6 changes: 4 additions & 2 deletions panda/board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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");
Expand Down

0 comments on commit 067f1bf

Please sign in to comment.