From 8802907ce274489690f8edf169454f750c8efe57 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Mon, 22 Jan 2018 15:57:24 +1100 Subject: Fix CDC device driver not returning written character on putchar success. --- LUFA/DoxygenPages/ChangeLog.txt | 2 ++ LUFA/Drivers/USB/Class/Device/CDCClassDevice.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index da8a6582e..8f299f7ea 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -10,6 +10,8 @@ * Fixed: * - Core: * - Fixed DeviceUsesOUTPipe flag not being set correctly in the HID host class driver (thanks to Wolfgang Schnerring) + * - Fixed CDC Device class driver's internal serial stream created by \ref CDC_Device_CreateStream not returning the written + * character after a successful write (thanks to NicoHood) * - Library Applications: * - Fixed bootloaders not disabling global interrupts during erase and write operations (thanks to Zoltan) * diff --git a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c index 27f8e722c..bf6e30141 100644 --- a/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -323,7 +323,7 @@ void CDC_Device_CreateBlockingStream(USB_ClassInfo_CDC_Device_t* const CDCInterf static int CDC_Device_putchar(char c, FILE* Stream) { - return CDC_Device_SendByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream), c) ? _FDEV_ERR : 0; + return CDC_Device_SendByte((USB_ClassInfo_CDC_Device_t*)fdev_get_udata(Stream), c) ? _FDEV_ERR : c; } static int CDC_Device_getchar(FILE* Stream) -- cgit v1.2.3