瀏覽代碼

Remove USB Serial.begin 2.5 second wait for connection

teensy4-core
PaulStoffregen 7 年之前
父節點
當前提交
0792b03a85
共有 1 個檔案被更改,包括 4 行新增3 行删除
  1. +4
    -3
      teensy3/usb_serial.h

+ 4
- 3
teensy3/usb_serial.h 查看文件

@@ -74,15 +74,16 @@ public:
constexpr usb_serial_class() {}
void begin(long) {
uint32_t millis_begin = systick_millis_count;
while (!(*this)) {
//disabled for now - causes more trouble than it solves?
//while (!(*this)) {
// wait up to 2.5 seconds for Arduino Serial Monitor
// Yes, this is a long time, but some Windows systems open
// the port very slowly. This wait allows programs for
// Arduino Uno to "just work" (without forcing a reboot when
// the port is opened), and when no PC is connected the user's
// sketch still gets to run normally after this wait time.
if ((uint32_t)(systick_millis_count - millis_begin) > 2500) break;
}
//if ((uint32_t)(systick_millis_count - millis_begin) > 2500) break;
//}
}
void end() { /* TODO: flush output and shut down USB port */ };
virtual int available() { return usb_serial_available(); }

Loading…
取消
儲存