Quellcode durchsuchen

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 vor 8 Jahren
Ursprung
Commit
9febfa653b
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. +2
    -1
      teensy3/usb_serial.c

+ 2
- 1
teensy3/usb_serial.c Datei anzeigen

@@ -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)

Laden…
Abbrechen
Speichern