浏览代码

Fix: write returns zero (#202)

https://forum.pjrc.com/threads/40893-Incorrect-return-for-Serial-write()-on-Teensy-3-6?p=127732#post127732

I'm not sure if this fix has some side-effects - how will other functions react when it does not return zero anymore ?
main
Frank 8 年前
父节点
当前提交
9febfa653b
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. +2
    -1
      teensy3/usb_serial.c

+ 2
- 1
teensy3/usb_serial.c 查看文件

@@ -189,6 +189,7 @@ int usb_serial_putchar(uint8_t c)

int usb_serial_write(const void *buffer, uint32_t size)
{
uint32_t ret = size;
uint32_t len;
uint32_t wait_count;
const uint8_t *src = (const uint8_t *)buffer;
@@ -231,7 +232,7 @@ int usb_serial_write(const void *buffer, uint32_t size)
usb_cdc_transmit_flush_timer = TRANSMIT_FLUSH_TIMEOUT;
}
tx_noautoflush = 0;
return 0;
return ret;
}

int usb_serial_write_buffer_free(void)

正在加载...
取消
保存