forked from mfulz_github/qmk_firmware
Added standard stream example to the ClassDriver CDC device demo.
Fix incorrect HWB button mask in the STK526 Buttons driver.
This commit is contained in:
parent
5ca1d7bf8f
commit
ce3ea6fb25
|
@ -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
|
/** Main program entry point. This routine contains the overall program flow, including initial
|
||||||
* setup of all components and the main program loop.
|
* setup of all components and the main program loop.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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).
|
* <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);
|
Endpoint_SelectEndpoint(CDC_TX_EPNUM);
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ static int CDC_putchar (char c, FILE *stream)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int CDC_getchar (FILE *stream)
|
static int CDC_getchar(FILE *stream)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
/* Public Interface - May be used in end-application: */
|
/* Public Interface - May be used in end-application: */
|
||||||
/* Macros: */
|
/* Macros: */
|
||||||
/** Button mask for the first button on the board. */
|
/** Button mask for the first button on the board. */
|
||||||
#define BUTTONS_BUTTON1 (1 << 2)
|
#define BUTTONS_BUTTON1 (1 << 7)
|
||||||
|
|
||||||
/* Inline Functions: */
|
/* Inline Functions: */
|
||||||
#if !defined(__DOXYGEN__)
|
#if !defined(__DOXYGEN__)
|
||||||
|
|
|
@ -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 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 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 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
|
* \section Sec_ChangeLog090605 Version 090605
|
||||||
|
|
Loading…
Reference in New Issue