diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-11 06:15:45 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2009-06-11 06:15:45 +0000 |
commit | 9798440ca4f694e7cd8312a51b82e59589f1ebeb (patch) | |
tree | daf8898224f4acd5092ecd54eb0cdf1a6a747664 /Demos/Device/ClassDriver/USBtoSerial | |
parent | b2330934b9ccd51a59183eb2a11fdd95183df27b (diff) | |
download | lufa-9798440ca4f694e7cd8312a51b82e59589f1ebeb.tar.gz lufa-9798440ca4f694e7cd8312a51b82e59589f1ebeb.tar.bz2 lufa-9798440ca4f694e7cd8312a51b82e59589f1ebeb.zip |
Changed to new device mode Class Driver function name prefixes to make way for similar host mode Class drivers.
Diffstat (limited to 'Demos/Device/ClassDriver/USBtoSerial')
-rw-r--r-- | Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c | 19 | ||||
-rw-r--r-- | Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.h | 2 |
2 files changed, 12 insertions, 9 deletions
diff --git a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c index 85826c2b3..dbe21c21c 100644 --- a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c +++ b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c @@ -74,21 +74,24 @@ int main(void) for (;;)
{
- for (uint8_t DataBytesRem = USB_CDC_BytesReceived(&VirtualSerial_CDC_Interface); DataBytesRem != 0; DataBytesRem--)
+ /* Read bytes from the USB OUT endpoint into the USART transmit buffer */
+ for (uint8_t DataBytesRem = CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface); DataBytesRem != 0; DataBytesRem--)
{
if (!(BUFF_STATICSIZE - Rx_Buffer.Elements))
break;
- Buffer_StoreElement(&Rx_Buffer, USB_CDC_ReceiveByte(&VirtualSerial_CDC_Interface));
+ Buffer_StoreElement(&Rx_Buffer, CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface));
}
+ /* Read bytes from the USART receive buffer into the USB IN endpoint */
if (Tx_Buffer.Elements)
- USB_CDC_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Rx_Buffer));
-
+ CDC_Device_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Tx_Buffer));
+
+ /* Read bytes from the USART transmit buffer into the USART */
if (Rx_Buffer.Elements)
Serial_TxByte(Buffer_GetElement(&Rx_Buffer));
- USB_CDC_USBTask(&VirtualSerial_CDC_Interface);
+ CDC_Device_USBTask(&VirtualSerial_CDC_Interface);
USB_USBTask();
}
}
@@ -126,14 +129,14 @@ void EVENT_USB_ConfigurationChanged(void) {
LEDs_SetAllLEDs(LEDMASK_USB_READY);
- if (!(USB_CDC_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
+ if (!(CDC_Device_ConfigureEndpoints(&VirtualSerial_CDC_Interface)))
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
}
/** Event handler for the library USB Unhandled Control Packet event. */
void EVENT_USB_UnhandledControlPacket(void)
{
- USB_CDC_ProcessControlPacket(&VirtualSerial_CDC_Interface);
+ CDC_Device_ProcessControlPacket(&VirtualSerial_CDC_Interface);
}
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer
@@ -149,7 +152,7 @@ ISR(USART1_RX_vect, ISR_BLOCK) *
* \param CDCInterfaceInfo Pointer to the CDC class interface configuration structure being referenced
*/
-void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
+void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo)
{
uint8_t ConfigMask = 0;
diff --git a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.h b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.h index 9660381bb..d46358255 100644 --- a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.h +++ b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.h @@ -74,6 +74,6 @@ void EVENT_USB_ConfigurationChanged(void);
void EVENT_USB_UnhandledControlPacket(void);
- void EVENT_USB_CDC_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
+ void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_t* CDCInterfaceInfo);
#endif
|