Pārlūkot izejas kodu

Merge pull request #382 from stawiski/teensy3-usb-delay-defines

Added the ability to parametrize Teensy 3 core USB init delays
main
Paul Stoffregen pirms 5 gadiem
vecāks
revīzija
67bc96922c
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam
1 mainītis faili ar 20 papildinājumiem un 8 dzēšanām
  1. +20
    -8
      teensy3/pins_teensy.c

+ 20
- 8
teensy3/pins_teensy.c Parādīt failu

@@ -583,18 +583,30 @@ void _init_Teensyduino_internal_(void)
TPM1_SC = FTM_SC_CLKS(1) | FTM_SC_PS(0);
#endif
analog_init();

#if !defined(TEENSY_INIT_USB_DELAY_BEFORE)
#if TEENSYDUINO >= 142
#define TEENSY_INIT_USB_DELAY_BEFORE 25
#else
#define TEENSY_INIT_USB_DELAY_BEFORE 50
#endif
#endif

#if !defined(TEENSY_INIT_USB_DELAY_AFTER)
#if TEENSYDUINO >= 142
#define TEENSY_INIT_USB_DELAY_AFTER 275
#else
#define TEENSY_INIT_USB_DELAY_AFTER 350
#endif
#endif

// for background about this startup delay, please see these conversations
// https://forum.pjrc.com/threads/36606-startup-time-(400ms)?p=113980&viewfull=1#post113980
// https://forum.pjrc.com/threads/31290-Teensey-3-2-Teensey-Loader-1-24-Issues?p=87273&viewfull=1#post87273
#if TEENSYDUINO >= 142
delay(25);
usb_init();
delay(275);
#else
delay(50);

delay(TEENSY_INIT_USB_DELAY_BEFORE);
usb_init();
delay(350);
#endif
delay(TEENSY_INIT_USB_DELAY_AFTER);
}



Notiek ielāde…
Atcelt
Saglabāt