mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
fixed PrintHex in kbd example
This commit is contained in:
parent
6e271b44aa
commit
900ba05c9b
3 changed files with 14 additions and 14 deletions
|
@ -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" : " ");
|
||||
|
|
|
@ -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("");
|
||||
}
|
||||
|
||||
|
|
|
@ -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("");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue