浏览代码

Use only DTR for (bool)Serial, RTS isn't reliable on Windows

teensy4-core
PaulStoffregen 6 年前
父节点
当前提交
5ae453cc5c
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. +2
    -3
      teensy3/usb_serial.h

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

uint8_t numbits(void) { return usb_cdc_line_coding[1] >> 16; } uint8_t numbits(void) { return usb_cdc_line_coding[1] >> 16; }
uint8_t dtr(void) { return (usb_cdc_line_rtsdtr & USB_SERIAL_DTR) ? 1 : 0; } uint8_t dtr(void) { return (usb_cdc_line_rtsdtr & USB_SERIAL_DTR) ? 1 : 0; }
uint8_t rts(void) { return (usb_cdc_line_rtsdtr & USB_SERIAL_RTS) ? 1 : 0; } uint8_t rts(void) { return (usb_cdc_line_rtsdtr & USB_SERIAL_RTS) ? 1 : 0; }
operator bool() { return usb_configuration &&
(usb_cdc_line_rtsdtr & (USB_SERIAL_DTR | USB_SERIAL_RTS)) &&
((uint32_t)(systick_millis_count - usb_cdc_line_rtsdtr_millis) >= 25);
operator bool() { return usb_configuration && (usb_cdc_line_rtsdtr & USB_SERIAL_DTR) &&
((uint32_t)(systick_millis_count - usb_cdc_line_rtsdtr_millis) >= 15);
} }
size_t readBytes(char *buffer, size_t length) { size_t readBytes(char *buffer, size_t length) {
size_t count=0; size_t count=0;

正在加载...
取消
保存