Browse Source

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 years ago
parent
commit
9febfa653b
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      teensy3/usb_serial.c

+ 2
- 1
teensy3/usb_serial.c View File



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


int usb_serial_write_buffer_free(void) int usb_serial_write_buffer_free(void)

Loading…
Cancel
Save