Oops: Really disable building of Projects/Host/ClassDriver directory in the Projects...
[pub/USBasp.git] / Demos / Device / ClassDriver / USBtoSerial / USBtoSerial.c
index b78a6d3..c46bb5d 100644 (file)
@@ -110,7 +110,7 @@ void SetupHardware(void)
        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
@@ -137,7 +137,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
 }\r
 \r
 /** Event handler for the library USB Unhandled Control Request event. */\r
-void EVENT_USB_Device_UnhandledControlPacket(void)\r
+void EVENT_USB_Device_UnhandledControlRequest(void)\r
 {\r
        CDC_Device_ProcessControlRequest(&VirtualSerial_CDC_Interface);\r
 }\r
@@ -147,8 +147,10 @@ void EVENT_USB_Device_UnhandledControlPacket(void)
  */\r
 ISR(USART1_RX_vect, ISR_BLOCK)\r
 {\r
+       uint8_t ReceivedByte = UDR1;\r
+\r
        if (USB_DeviceState == DEVICE_STATE_Configured)\r
-         Buffer_StoreElement(&Tx_Buffer, UDR1);\r
+         Buffer_StoreElement(&Tx_Buffer, ReceivedByte);\r
 }\r
 \r
 /** Event handler for the CDC Class driver Line Encoding Changed event.\r