]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Give better debug message in usb_keyboard_checkkey
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 21 Aug 2010 17:42:31 +0000 (19:42 +0200)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Sat, 21 Aug 2010 17:42:31 +0000 (19:42 +0200)
term/usb_keyboard.c

index 1a486b53d500c623f5339d2103d604b05df19a16..e9be331cf9101e63e00fb9c2a6c33c3ab67a0702 100644 (file)
@@ -258,6 +258,13 @@ grub_usb_keyboard_checkkey (struct grub_term_input *term)
 
   grub_memcpy (data, termdata->report, sizeof (data));
 
+  grub_dprintf ("usb_keyboard",
+               "err = %d, actual = %d report: 0x%02x 0x%02x 0x%02x 0x%02x"
+               " 0x%02x 0x%02x 0x%02x 0x%02x\n",
+               err, actual,
+               data[0], data[1], data[2], data[3],
+               data[4], data[5], data[6], data[7]);
+
   termdata->transfer = grub_usb_bulk_read_background (termdata->usbdev,
                                                      termdata->endp->endp_addr,
                                                      sizeof (termdata->report),
@@ -276,12 +283,6 @@ grub_usb_keyboard_checkkey (struct grub_term_input *term)
   if (actual < 3 || !data[2])
     return -1;
 
-  grub_dprintf ("usb_keyboard",
-               "report: 0x%02x 0x%02x 0x%02x 0x%02x"
-               " 0x%02x 0x%02x 0x%02x 0x%02x\n",
-               data[0], data[1], data[2], data[3],
-               data[4], data[5], data[6], data[7]);
-
   /* Check if the Control or Shift key was pressed.  */
   if (data[0] & 0x01 || data[0] & 0x10)
     termdata->key = keyboard_map[data[2]] - 'a' + 1;