Fix demos based on the device mode HID class driver, as well as the driver itself...
[pub/USBasp.git] / Projects / Benito / Benito.c
index 1afb74a..26c5664 100644 (file)
@@ -67,11 +67,6 @@ USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
                                .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
@@ -84,7 +79,7 @@ int main(void)
        for (;;)\r
        {\r
                /* Echo bytes from the host to the target via the hardware USART */\r
-               if (CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface))\r
+               if (CDC_Device_BytesReceived(&VirtualSerial_CDC_Interface) > 0)\r
                {\r
                        Serial_TxByte(CDC_Device_ReceiveByte(&VirtualSerial_CDC_Interface));\r
 \r
@@ -107,7 +102,7 @@ int main(void)
                        /* Check if the LEDs should be ping-ponging (during enumeration) */\r
                        if (PingPongMSRemaining && !(--PingPongMSRemaining))\r
                        {\r
-                               LEDs_ChangeLEDs(LEDMASK_BUSY, (~LEDs_GetLEDs() & LEDMASK_BUSY));\r
+                               LEDs_ToggleLEDs(LEDMASK_BUSY);\r
                                PingPongMSRemaining = PING_PONG_LED_PULSE_MS;\r
                        }\r
                \r