fixed PrintHex in kbd example

This commit is contained in:
Oleg Mazurov 2013-08-14 14:08:37 -06:00
parent 6e271b44aa
commit 900ba05c9b
3 changed files with 14 additions and 14 deletions

View file

@ -37,7 +37,7 @@ void KbdRptParser::PrintKey(uint8_t m, uint8_t key)
Serial.print((mod.bmLeftGUI == 1) ? "G" : " ");
Serial.print(" >");
D_PrintHex<uint8_t>(key, 0x80);
PrintHex<uint8_t>(key, 0x80);
Serial.print("< ");
Serial.print((mod.bmRightCtrl == 1) ? "C" : " ");

View file

@ -63,22 +63,22 @@ void JoystickReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t
void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt)
{
Serial.print("X: ");
D_PrintHex<uint8_t>(evt->X, 0x80);
PrintHex<uint8_t>(evt->X, 0x80);
Serial.print("\tY: ");
D_PrintHex<uint8_t>(evt->Y, 0x80);
PrintHex<uint8_t>(evt->Y, 0x80);
Serial.print("\tZ: ");
D_PrintHex<uint8_t>(evt->Z1, 0x80);
PrintHex<uint8_t>(evt->Z1, 0x80);
Serial.print("\tZ: ");
D_PrintHex<uint8_t>(evt->Z2, 0x80);
PrintHex<uint8_t>(evt->Z2, 0x80);
Serial.print("\tRz: ");
D_PrintHex<uint8_t>(evt->Rz, 0x80);
PrintHex<uint8_t>(evt->Rz, 0x80);
Serial.println("");
}
void JoystickEvents::OnHatSwitch(uint8_t hat)
{
Serial.print("Hat Switch: ");
D_PrintHex<uint8_t>(hat, 0x80);
PrintHex<uint8_t>(hat, 0x80);
Serial.println("");
}

View file

@ -26,18 +26,18 @@ void JoystickReportParser::Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t
void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt)
{
Serial.print("X: ");
D_PrintHex<uint16_t>(evt->x, 0x80);
PrintHex<uint16_t>(evt->x, 0x80);
Serial.print(" Y: ");
D_PrintHex<uint16_t>(evt->y, 0x80);
PrintHex<uint16_t>(evt->y, 0x80);
Serial.print(" Hat Switch: ");
D_PrintHex<uint8_t>(evt->hat, 0x80);
PrintHex<uint8_t>(evt->hat, 0x80);
Serial.print(" Twist: ");
D_PrintHex<uint8_t>(evt->twist, 0x80);
PrintHex<uint8_t>(evt->twist, 0x80);
Serial.print(" Slider: ");
D_PrintHex<uint8_t>(evt->slider, 0x80);
PrintHex<uint8_t>(evt->slider, 0x80);
Serial.print(" Buttons A: ");
D_PrintHex<uint8_t>(evt->buttons_a, 0x80);
PrintHex<uint8_t>(evt->buttons_a, 0x80);
Serial.print(" Buttons B: ");
D_PrintHex<uint8_t>(evt->buttons_b, 0x80);
PrintHex<uint8_t>(evt->buttons_b, 0x80);
Serial.println("");
}