Fixed broken USE_RAM_DESCRIPTORS compile time option when the FIXED_NUM_CONFIGURATION...
[pub/USBasp.git] / LUFA / Drivers / USB / Class / Device / CDCClassDevice.c
index baa0e52..c366c2f 100644 (file)
@@ -1,13 +1,13 @@
 /*
              LUFA Library
-     Copyright (C) Dean Camera, 2013.
+     Copyright (C) Dean Camera, 2015.
 
   dean [at] fourwalledcubicle [dot] com
            www.lufa-lib.org
 */
 
 /*
-  Copyright 2013  Dean Camera (dean [at] fourwalledcubicle [dot] com)
+  Copyright 2015  Dean Camera (dean [at] fourwalledcubicle [dot] com)
 
   Permission to use, copy, modify, distribute, and sell this
   software and its documentation for any purpose is hereby granted
@@ -155,6 +155,16 @@ uint8_t CDC_Device_SendString(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo
        return Endpoint_Write_Stream_LE(String, strlen(String), NULL);
 }
 
+uint8_t CDC_Device_SendString_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
+                              const char* const String)
+{
+       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
+         return ENDPOINT_RWSTREAM_DeviceDisconnected;
+
+       Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
+       return Endpoint_Write_PStream_LE(String, strlen_P(String), NULL);
+}
+
 uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
                             const void* const Buffer,
                             const uint16_t Length)
@@ -166,6 +176,17 @@ uint8_t CDC_Device_SendData(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
        return Endpoint_Write_Stream_LE(Buffer, Length, NULL);
 }
 
+uint8_t CDC_Device_SendData_P(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
+                            const void* const Buffer,
+                            const uint16_t Length)
+{
+       if ((USB_DeviceState != DEVICE_STATE_Configured) || !(CDCInterfaceInfo->State.LineEncoding.BaudRateBPS))
+         return ENDPOINT_RWSTREAM_DeviceDisconnected;
+
+       Endpoint_SelectEndpoint(CDCInterfaceInfo->Config.DataINEndpoint.Address);
+       return Endpoint_Write_PStream_LE(Buffer, Length, NULL);
+}
+
 uint8_t CDC_Device_SendByte(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo,
                             const uint8_t Data)
 {