projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Commit for the 090810 release.
[pub/USBasp.git]
/
Demos
/
Device
/
ClassDriver
/
USBtoSerial
/
USBtoSerial.c
diff --git
a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
index
ac63f0f
..
0c83cd8
100644
(file)
--- a/
Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
+++ b/
Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c
@@
-61,11
+61,6
@@
USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
\r
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
\r
},
\r
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
\r
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
\r
},
\r
-
\r
- .State =
\r
- {
\r
- // Leave all state values to their defaults
\r
- }
\r
};
\r
\r
/** Main program entry point. This routine contains the overall program flow, including initial
\r
};
\r
\r
/** Main program entry point. This routine contains the overall program flow, including initial
\r
@@
-95,7
+90,7
@@
int main(void)
if (Tx_Buffer.Elements)
\r
CDC_Device_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Tx_Buffer));
\r
\r
if (Tx_Buffer.Elements)
\r
CDC_Device_SendByte(&VirtualSerial_CDC_Interface, Buffer_GetElement(&Tx_Buffer));
\r
\r
- /*
Re
ad bytes from the USART transmit buffer into the USART */
\r
+ /*
Lo
ad bytes from the USART transmit buffer into the USART */
\r
if (Rx_Buffer.Elements)
\r
Serial_TxByte(Buffer_GetElement(&Rx_Buffer));
\r
\r
if (Rx_Buffer.Elements)
\r
Serial_TxByte(Buffer_GetElement(&Rx_Buffer));
\r
\r
@@
-115,25
+110,25
@@
void SetupHardware(void)
clock_prescale_set(clock_div_1);
\r
\r
/* Hardware Initialization */
\r
clock_prescale_set(clock_div_1);
\r
\r
/* Hardware Initialization */
\r
-
Joystick_Init(
);
\r
+
Serial_Init(9600, false
);
\r
LEDs_Init();
\r
USB_Init();
\r
}
\r
\r
/** Event handler for the library USB Connection event. */
\r
LEDs_Init();
\r
USB_Init();
\r
}
\r
\r
/** Event handler for the library USB Connection event. */
\r
-void EVENT_USB_Connect(void)
\r
+void EVENT_USB_
Device_
Connect(void)
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
\r
}
\r
\r
/** Event handler for the library USB Disconnection event. */
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_ENUMERATING);
\r
}
\r
\r
/** Event handler for the library USB Disconnection event. */
\r
-void EVENT_USB_Disconnect(void)
\r
+void EVENT_USB_D
evice_D
isconnect(void)
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
\r
}
\r
\r
/** Event handler for the library USB Configuration Changed event. */
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_NOTREADY);
\r
}
\r
\r
/** Event handler for the library USB Configuration Changed event. */
\r
-void EVENT_USB_ConfigurationChanged(void)
\r
+void EVENT_USB_
Device_
ConfigurationChanged(void)
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);
\r
\r
{
\r
LEDs_SetAllLEDs(LEDMASK_USB_READY);
\r
\r
@@
-141,10
+136,10
@@
void EVENT_USB_ConfigurationChanged(void)
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
\r
}
\r
\r
LEDs_SetAllLEDs(LEDMASK_USB_ERROR);
\r
}
\r
\r
-/** Event handler for the library USB Unhandled Control
Packe
t event. */
\r
-void EVENT_USB_UnhandledControlPacket(void)
\r
+/** Event handler for the library USB Unhandled Control
Reques
t event. */
\r
+void EVENT_USB_
Device_
UnhandledControlPacket(void)
\r
{
\r
{
\r
- CDC_Device_ProcessControl
Packe
t(&VirtualSerial_CDC_Interface);
\r
+ CDC_Device_ProcessControl
Reques
t(&VirtualSerial_CDC_Interface);
\r
}
\r
\r
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer
\r
}
\r
\r
/** ISR to manage the reception of data from the serial port, placing received bytes into a circular buffer
\r
@@
-152,7
+147,7
@@
void EVENT_USB_UnhandledControlPacket(void)
*/
\r
ISR(USART1_RX_vect, ISR_BLOCK)
\r
{
\r
*/
\r
ISR(USART1_RX_vect, ISR_BLOCK)
\r
{
\r
- if (USB_
IsConnect
ed)
\r
+ if (USB_
DeviceState == DEVICE_STATE_Configur
ed)
\r
Buffer_StoreElement(&Tx_Buffer, UDR1);
\r
}
\r
\r
Buffer_StoreElement(&Tx_Buffer, UDR1);
\r
}
\r
\r