瀏覽代碼

Fix USB serial issues printing before device ready

teensy4-core
PaulStoffregen 6 年之前
父節點
當前提交
a1ff3e9256
共有 2 個檔案被更改,包括 3 行新增2 行删除
  1. +2
    -2
      teensy4/usb.c
  2. +1
    -0
      teensy4/usb_serial.c

+ 2
- 2
teensy4/usb.c 查看文件

@@ -334,8 +334,8 @@ static void endpoint0_setup(uint64_t setupdata)
}
break;
case 0x2221: // CDC_SET_CONTROL_LINE_STATE
//usb_cdc_line_rtsdtr_millis = systick_millis_count;
//usb_cdc_line_rtsdtr = setup.wValue;
usb_cdc_line_rtsdtr_millis = systick_millis_count;
usb_cdc_line_rtsdtr = setup.wValue;
case 0x2321: // CDC_SEND_BREAK
endpoint0_receive(NULL, 0, 0);
return;

+ 1
- 0
teensy4/usb_serial.c 查看文件

@@ -212,6 +212,7 @@ static uint8_t txbuffer[1024];

int usb_serial_write(const void *buffer, uint32_t size)
{
if (!usb_configuration) return 0;
// TODO: do something so much better that this quick hack....
if (size > sizeof(txbuffer)) size = sizeof(txbuffer);
int count=0;

Loading…
取消
儲存