X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/c5038f1bf44aea75f1ae1ed035cb7d523ccfdacb..31d8ebebc0796873f7c70db80a04acdcbb307ed8:/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c diff --git a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c index b78a6d331..c46bb5d01 100644 --- a/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c +++ b/Demos/Device/ClassDriver/USBtoSerial/USBtoSerial.c @@ -110,7 +110,7 @@ void SetupHardware(void) clock_prescale_set(clock_div_1); /* Hardware Initialization */ - Joystick_Init(); + Serial_Init(9600, false); LEDs_Init(); USB_Init(); } @@ -137,7 +137,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) } /** Event handler for the library USB Unhandled Control Request event. */ -void EVENT_USB_Device_UnhandledControlPacket(void) +void EVENT_USB_Device_UnhandledControlRequest(void) { CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface); } @@ -147,8 +147,10 @@ void EVENT_USB_Device_UnhandledControlPacket(void) */ ISR(USART1_RX_vect, ISR_BLOCK) { + uint8_t ReceivedByte = UDR1; + if (USB_DeviceState == DEVICE_STATE_Configured) - Buffer_StoreElement(&Tx_Buffer, UDR1); + Buffer_StoreElement(&Tx_Buffer, ReceivedByte); } /** Event handler for the CDC Class driver Line Encoding Changed event.