浏览代码

Added the ability to parametrize Teensy 3 core USB init delays through compiler defines (TEENSY_INIT_USB_DELAY_BEFORE, TEENSY_INIT_USB_DELAY_AFTER). When defines are not present, default values are used, depending on teensy version.

main
Mikolaj 5 年前
父节点
当前提交
d7a15b0210
共有 1 个文件被更改,包括 20 次插入8 次删除
  1. +20
    -8
      teensy3/pins_teensy.c

+ 20
- 8
teensy3/pins_teensy.c 查看文件

@@ -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);
}



正在加载...
取消
保存