Give better debug message in usb_keyboard_checkkey

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-08-21 19:42:31 +02:00
parent 0aaf4938c7
commit 5a2823c191

View 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;