From 854fb80e0891a8c82d0c84c8af84a3c93166e70b Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 19 Apr 2016 11:34:04 +0200 Subject: [PATCH] Autoformat USBHIDMultimediaKbd example No code change --- .../USBHIDMultimediaKbd.ino | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/examples/HID/USBHIDMultimediaKbd/USBHIDMultimediaKbd.ino b/examples/HID/USBHIDMultimediaKbd/USBHIDMultimediaKbd.ino index 598d94c1..f3b79dce 100644 --- a/examples/HID/USBHIDMultimediaKbd/USBHIDMultimediaKbd.ino +++ b/examples/HID/USBHIDMultimediaKbd/USBHIDMultimediaKbd.ino @@ -11,17 +11,17 @@ class HIDSelector : public HIDComposite { public: - HIDSelector(USB *p) : HIDComposite(p) {}; + HIDSelector(USB *p) : HIDComposite(p) {}; protected: - void ParseHIDData(USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf); // Called by the HIDComposite library - bool SelectInterface(uint8_t iface, uint8_t proto); + void ParseHIDData(USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf); // Called by the HIDComposite library + bool SelectInterface(uint8_t iface, uint8_t proto); }; // Return true for the interface we want to hook into bool HIDSelector::SelectInterface(uint8_t iface, uint8_t proto) { - if(proto != 0) + if (proto != 0) return true; return false; @@ -30,22 +30,20 @@ bool HIDSelector::SelectInterface(uint8_t iface, uint8_t proto) // Will be called for all HID data received from the USB interface void HIDSelector::ParseHIDData(USBHID *hid, uint8_t ep, bool is_rpt_id, uint8_t len, uint8_t *buf) { #if 1 - if (len && buf) { - Notify(PSTR("\r\n"), 0x80); - for (uint8_t i = 0; i < len; i++) { - D_PrintHex (buf[i], 0x80); - Notify(PSTR(" "), 0x80); - } - } + if (len && buf) { + Notify(PSTR("\r\n"), 0x80); + for (uint8_t i = 0; i < len; i++) { + D_PrintHex (buf[i], 0x80); + Notify(PSTR(" "), 0x80); + } + } #endif } - USB Usb; //USBHub Hub(&Usb); HIDSelector hidSelector(&Usb); - void setup() { Serial.begin( 115200 );