ソースを参照

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)

読み込み中…
キャンセル
保存