diff --git a/Demos/Device/ClassDriver/CDC/CDC.c b/Demos/Device/ClassDriver/CDC/CDC.c index 3e83ec2696e3e07a6eda91b1fc7709043382bc20..836a6e098fe5ce8c7ecd70a851948c4bf55300aa 100644 --- a/Demos/Device/ClassDriver/CDC/CDC.c +++ b/Demos/Device/ClassDriver/CDC/CDC.c @@ -57,6 +57,28 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface = }, }; +#if 0 +/* NOTE: Here you can set up a standard stream using the created virtual serial port, so that the standard stream functions in + * <stdio.h> can be used on the virtual serial port (e.g. fprintf(&USBSerial, "Test"); to print a string). + */ + +static int CDC_putchar(char c, FILE *stream) +{ + CDC_Device_SendByte(&VirtualSerial_CDC_Interface, c); + return 0; +} + +static int CDC_getchar(FILE *stream) +{ + if (!(CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface))) + return -1; + + return CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface); +} + +static FILE USBSerial = FDEV_SETUP_STREAM(CDC_putchar, CDC_getchar, _FDEV_SETUP_RW); +#endif + /** Main program entry point. This routine contains the overall program flow, including initial * setup of all components and the main program loop. */ diff --git a/Demos/Device/LowLevel/CDC/CDC.c b/Demos/Device/LowLevel/CDC/CDC.c index e63257dbdc2dc7a934d1d278f3c67082b3b3693b..8a992c7670dc5587483d2a7007e01493c4fb292b 100644 --- a/Demos/Device/LowLevel/CDC/CDC.c +++ b/Demos/Device/LowLevel/CDC/CDC.c @@ -55,7 +55,7 @@ CDC_Line_Coding_t LineCoding = { .BaudRateBPS = 9600, * <stdio.h> can be used on the virtual serial port (e.g. fprintf(&USBSerial, "Test"); to print a string). */ -static int CDC_putchar (char c, FILE *stream) +static int CDC_putchar(char c, FILE *stream) { Endpoint_SelectEndpoint(CDC_TX_EPNUM); @@ -71,7 +71,7 @@ static int CDC_putchar (char c, FILE *stream) return 0; } -static int CDC_getchar (FILE *stream) +static int CDC_getchar(FILE *stream) { int c; diff --git a/LUFA/Drivers/Board/STK526/Buttons.h b/LUFA/Drivers/Board/STK526/Buttons.h index fba578cb202e5996cd2de23d2c722993e03f0ef6..9d392f2deed1a26ff00fcbc4b95afcdf79f29db3 100644 --- a/LUFA/Drivers/Board/STK526/Buttons.h +++ b/LUFA/Drivers/Board/STK526/Buttons.h @@ -64,7 +64,7 @@ /* Public Interface - May be used in end-application: */ /* Macros: */ /** Button mask for the first button on the board. */ - #define BUTTONS_BUTTON1 (1 << 2) + #define BUTTONS_BUTTON1 (1 << 7) /* Inline Functions: */ #if !defined(__DOXYGEN__) diff --git a/LUFA/ManPages/ChangeLog.txt b/LUFA/ManPages/ChangeLog.txt index 483e0a6fd60c1941815fd8401fda87f92220d438..02146a20a046faf546c225414dd9f39d2c4f2222 100644 --- a/LUFA/ManPages/ChangeLog.txt +++ b/LUFA/ManPages/ChangeLog.txt @@ -76,6 +76,7 @@ * - Fixed incorrect PIPE_EPNUM_MASK mask causing pipe failures on devices with endpoint addresses of 8 and above (thanks to John Andrews) * - Fixed report data alignment issues in the MouseHostWithParser demo when X and Y movement data size is not a multiple of 8 bits * - Fixed HID Report Descriptor Parser not correctly resetting internal states when a REPORT ID element is encountered + * - Fixed incorrect BUTTONS_BUTTON1 for the STK526 target * * * \section Sec_ChangeLog090605 Version 090605