Skip to content

Commit e718225

Browse files
committed
Arduino IDE COM port changes after uploading sketch
Reduce timeout time along with clock frequency to make sure COM port timing is aligned with Arduino IDE detection rules. See arduino/Arduino#3495
1 parent 109c010 commit e718225

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mtk/avr/bootloaders/caterina/Caterina.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ uint16_t RxLEDPulse = 0; // time remaining for Rx LED pulse
7070
#if F_CPU == 8000000
7171
#define TIMEOUT_PERIOD 4000
7272
#define EXT_RESET_TIMEOUT_PERIOD 375
73+
#define RESPONSE_TIMEOUT_PERIOD 250
7374
#else
7475
#define TIMEOUT_PERIOD 8000
7576
#define EXT_RESET_TIMEOUT_PERIOD 750
77+
#define RESPONSE_TIMEOUT_PERIOD 500
7678
#endif
7779

7880
// MAH 8/15/12- make this volatile, since we modify it in one place and read it in another, we want to make
@@ -588,7 +590,7 @@ void CDC_Task(void)
588590
* leaving just a few hundred milliseconds so the
589591
* bootloder has time to respond and service any
590592
* subsequent requests */
591-
Timeout = TIMEOUT_PERIOD - 500;
593+
Timeout = TIMEOUT_PERIOD - RESPONSE_TIMEOUT_PERIOD;
592594

593595
/* Re-enable RWW section - must be done here in case
594596
* user has disabled verification on upload. */

0 commit comments

Comments
 (0)