fixed printhex

This commit is contained in:
Oleg Mazurov 2013-04-03 13:08:24 -06:00
parent feda989245
commit e1a11e9d5c
3 changed files with 8 additions and 8 deletions

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) void JoystickEvents::OnGamePadChanged(const GamePadEventData *evt)
{ {
Serial.print("X: "); Serial.print("X: ");
PrintHex<uint16_t>(evt->x); PrintHex<uint16_t>(evt->x, 0x80);
Serial.print(" Y: "); Serial.print(" Y: ");
PrintHex<uint16_t>(evt->y); PrintHex<uint16_t>(evt->y, 0x80);
Serial.print(" Hat Switch: "); Serial.print(" Hat Switch: ");
PrintHex<uint8_t>(evt->hat); PrintHex<uint8_t>(evt->hat, 0x80);
Serial.print(" Twist: "); Serial.print(" Twist: ");
PrintHex<uint8_t>(evt->twist); PrintHex<uint8_t>(evt->twist, 0x80);
Serial.print(" Slider: "); Serial.print(" Slider: ");
PrintHex<uint8_t>(evt->slider); PrintHex<uint8_t>(evt->slider, 0x80);
Serial.print(" Buttons A: "); Serial.print(" Buttons A: ");
PrintHex<uint8_t>(evt->buttons_a); PrintHex<uint8_t>(evt->buttons_a, 0x80);
Serial.print(" Buttons B: "); Serial.print(" Buttons B: ");
PrintHex<uint8_t>(evt->buttons_b); PrintHex<uint8_t>(evt->buttons_b, 0x80);
Serial.println(""); Serial.println("");
} }

View file

@ -57,4 +57,4 @@ public:
virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf); virtual void Parse(HID *hid, bool is_rpt_id, uint8_t len, uint8_t *buf);
}; };
#endif // __HIDJOYSTICKRPTPARSER_H__ #endif // __HIDJOYSTICKRPTPARSER_H__