Add new Audio Class Driver Host demos.
[pub/USBasp.git] / Demos / Host / LowLevel / KeyboardHost / KeyboardHost.c
index e2e6e36..6df052d 100644 (file)
@@ -103,7 +103,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void)
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
 void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 {
 /** Event handler for the USB_HostError event. This indicates that a hardware error occurred while in host mode. */
 void EVENT_USB_Host_HostError(const uint8_t ErrorCode)
 {
-       USB_ShutDown();
+       USB_Disable();
 
        printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"
                                 " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);
 
        printf_P(PSTR(ESC_FG_RED "Host Mode Error\r\n"
                                 " -- Error Code %d\r\n" ESC_FG_WHITE), ErrorCode);
@@ -173,9 +173,13 @@ void ReadNextReport(void)
                                PressedKey = (KeyCode - HID_KEYBOARD_SC_A) + 'A';
                        }
                        else if ((KeyCode >= HID_KEYBOARD_SC_1_AND_EXCLAMATION) &
                                PressedKey = (KeyCode - HID_KEYBOARD_SC_A) + 'A';
                        }
                        else if ((KeyCode >= HID_KEYBOARD_SC_1_AND_EXCLAMATION) &
-                                        (KeyCode <= HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS))
+                                        (KeyCode  < HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS))
                        {
                        {
-                               PressedKey = (KeyCode - HID_KEYBOARD_SC_1_AND_EXCLAMATION) + '0';
+                               PressedKey = (KeyCode - HID_KEYBOARD_SC_1_AND_EXCLAMATION) + '1';
+                       }
+                       else if (KeyCode == HID_KEYBOARD_SC_0_AND_CLOSING_PARENTHESIS)
+                       {
+                               PressedKey = '0';
                        }
                        else if (KeyCode == HID_KEYBOARD_SC_SPACE)
                        {
                        }
                        else if (KeyCode == HID_KEYBOARD_SC_SPACE)
                        {