diff options
author | Dean Camera <[email protected]> | 2011-01-30 21:02:31 +0000 |
---|---|---|
committer | Dean Camera <[email protected]> | 2011-01-30 21:02:31 +0000 |
commit | 43c473530552acabcf5bb1db29555bfb5ea70b79 (patch) | |
tree | b67e5b8295633262ed839e1c74f81a65b4dd59ea /LUFA/Drivers/USB/Class/Device/CDC.c | |
parent | afd828c095f38753e989391eab670b8736e4bd6e (diff) | |
download | qmk_firmware-43c473530552acabcf5bb1db29555bfb5ea70b79.tar.gz qmk_firmware-43c473530552acabcf5bb1db29555bfb5ea70b79.zip |
Renamed the PRNT_Host_SendString(), CDC_Host_SendString() and CDC_Device_SendString() functions to *_SendData(), and added new versions of the *_SendString() routines that expect a null terminated string instead.
Added new Serial_SendData() function to the Serial driver.
Diffstat (limited to 'LUFA/Drivers/USB/Class/Device/CDC.c')
-rw-r--r-- | LUFA/Drivers/USB/Class/Device/CDC.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Class/Device/CDC.c b/LUFA/Drivers/USB/Class/Device/CDC.c index e3d1c4def5..838bd712d2 100644 --- a/LUFA/Drivers/USB/Class/Device/CDC.c +++ b/LUFA/Drivers/USB/Class/Device/CDC.c @@ -154,14 +154,24 @@ void CDC_Device_USBTask(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) } uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, - const char* const Data, - const uint16_t Length) + const char* const String) { if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) return ENDPOINT_RWSTREAM_DeviceDisconnected; Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber); - return Endpoint_Write_Stream_LE(Data, Length, NULL); + return Endpoint_Write_Stream_LE(String, strlen(String), NULL); +} + +uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, + const char* const Buffer, + const uint16_t Length) +{ + if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS)) + return ENDPOINT_RWSTREAM_DeviceDisconnected; + + Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpointNumber); + return Endpoint_Write_Stream_LE(Buffer, Length, NULL); } uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, |