diff --git a/examples/HID/USBHIDBootKbdAndMouse/USBHIDBootKbdAndMouse.ino b/examples/HID/USBHIDBootKbdAndMouse/USBHIDBootKbdAndMouse.ino index 75fc405d..74e0a2e5 100644 --- a/examples/HID/USBHIDBootKbdAndMouse/USBHIDBootKbdAndMouse.ino +++ b/examples/HID/USBHIDBootKbdAndMouse/USBHIDBootKbdAndMouse.ino @@ -138,8 +138,8 @@ void KbdRptParser::OnKeyPressed(uint8_t key) Serial.println((char)key); }; -USBHost usb; -USBHub Hub(&usb); +USBHost usb; +USBHub Hub(&usb); HIDBoot < USB_HID_PROTOCOL_KEYBOARD | USB_HID_PROTOCOL_MOUSE > HidComposite(&usb); HIDBoot HidKeyboard(&usb); diff --git a/examples/HID/USBHIDBootMouse/USBHIDBootMouse.ino b/examples/HID/USBHIDBootMouse/USBHIDBootMouse.ino index 55581be1..4ed0a8b4 100644 --- a/examples/HID/USBHIDBootMouse/USBHIDBootMouse.ino +++ b/examples/HID/USBHIDBootMouse/USBHIDBootMouse.ino @@ -10,70 +10,70 @@ class MouseRptParser : public MouseReportParser { protected: - void OnMouseMove (MOUSEINFO *mi); - void OnLeftButtonUp (MOUSEINFO *mi); - void OnLeftButtonDown (MOUSEINFO *mi); - void OnRightButtonUp (MOUSEINFO *mi); - void OnRightButtonDown (MOUSEINFO *mi); - void OnMiddleButtonUp (MOUSEINFO *mi); - void OnMiddleButtonDown (MOUSEINFO *mi); + void OnMouseMove (MOUSEINFO *mi); + void OnLeftButtonUp (MOUSEINFO *mi); + void OnLeftButtonDown (MOUSEINFO *mi); + void OnRightButtonUp (MOUSEINFO *mi); + void OnRightButtonDown (MOUSEINFO *mi); + void OnMiddleButtonUp (MOUSEINFO *mi); + void OnMiddleButtonDown (MOUSEINFO *mi); }; void MouseRptParser::OnMouseMove(MOUSEINFO *mi) { - Serial.print("dx="); - Serial.print(mi->dX, DEC); - Serial.print(" dy="); - Serial.println(mi->dY, DEC); + Serial.print("dx="); + Serial.print(mi->dX, DEC); + Serial.print(" dy="); + Serial.println(mi->dY, DEC); }; void MouseRptParser::OnLeftButtonUp (MOUSEINFO *mi) { - Serial.println("L Butt Up"); + Serial.println("L Butt Up"); }; void MouseRptParser::OnLeftButtonDown (MOUSEINFO *mi) { - Serial.println("L Butt Dn"); + Serial.println("L Butt Dn"); }; void MouseRptParser::OnRightButtonUp (MOUSEINFO *mi) { - Serial.println("R Butt Up"); + Serial.println("R Butt Up"); }; void MouseRptParser::OnRightButtonDown (MOUSEINFO *mi) { - Serial.println("R Butt Dn"); + Serial.println("R Butt Dn"); }; void MouseRptParser::OnMiddleButtonUp (MOUSEINFO *mi) { - Serial.println("M Butt Up"); + Serial.println("M Butt Up"); }; void MouseRptParser::OnMiddleButtonDown (MOUSEINFO *mi) { - Serial.println("M Butt Dn"); + Serial.println("M Butt Dn"); }; -USBHost usb; -USBHub Hub(&usb); -HIDBoot HidMouse(&usb); +USBHost usb; +USBHub Hub(&usb); +HIDBoot HidMouse(&usb); uint32_t next_time; -MouseRptParser Prs; +MouseRptParser Prs; void setup() { - Serial.begin( 115200 ); + Serial.begin( 115200 ); #if !defined(__MIPSEL__) - while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection + while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection #endif - Serial.println("Start"); + Serial.println("Start"); - if (usb.Init() == -1) - Serial.println("OSC did not start."); + if (usb.Init() == -1) + Serial.println("OSC did not start."); - delay( 200 ); + delay( 200 ); - next_time = millis() + 5000; + next_time = millis() + 5000; - HidMouse.SetReportParser(0,(HIDReportParser*)&Prs); + HidMouse.SetReportParser(0, (HIDReportParser*)&Prs); } void loop() diff --git a/examples/HID/USBHIDJoystick/USBHIDJoystick.ino b/examples/HID/USBHIDJoystick/USBHIDJoystick.ino index 8fce4563..f0574702 100644 --- a/examples/HID/USBHIDJoystick/USBHIDJoystick.ino +++ b/examples/HID/USBHIDJoystick/USBHIDJoystick.ino @@ -17,22 +17,22 @@ JoystickEvents JoyEvents; JoystickReportParser Joy(&JoyEvents); void setup() { - Serial.begin(115200); + Serial.begin(115200); #if !defined(__MIPSEL__) - while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection + while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection #endif - Serial.println("Start"); + Serial.println("Start"); - if (usb.Init() == -1) - Serial.println("OSC did not start."); + if (usb.Init() == -1) + Serial.println("OSC did not start."); - delay(200); + delay(200); - if (!Hid.SetReportParser(0, &Joy)) - ErrorMessage (PSTR("SetReportParser"), 1); + if (!Hid.SetReportParser(0, &Joy)) + ErrorMessage (PSTR("SetReportParser"), 1); } void loop() { - usb.Task(); + usb.Task(); } diff --git a/examples/HID/USBHID_desc/USBHID_desc.ino b/examples/HID/USBHID_desc/USBHID_desc.ino index 20b810ab..93c5bcd2 100644 --- a/examples/HID/USBHID_desc/USBHID_desc.ino +++ b/examples/HID/USBHID_desc/USBHID_desc.ino @@ -21,31 +21,31 @@ protected: uint8_t HIDUniversal2::OnInitSuccessful() { - uint8_t rcode; + uint8_t rcode; - HexDumper Hex; - ReportDescParser Rpt; + HexDumper Hex; + ReportDescParser Rpt; - if ((rcode = GetReportDescr(0, &Hex))) - goto FailGetReportDescr1; + if ((rcode = GetReportDescr(0, &Hex))) + goto FailGetReportDescr1; - if ((rcode = GetReportDescr(0, &Rpt))) - goto FailGetReportDescr2; + if ((rcode = GetReportDescr(0, &Rpt))) + goto FailGetReportDescr2; - return 0; + return 0; FailGetReportDescr1: - USBTRACE("GetReportDescr1:"); - goto Fail; + USBTRACE("GetReportDescr1:"); + goto Fail; FailGetReportDescr2: - USBTRACE("GetReportDescr2:"); - goto Fail; + USBTRACE("GetReportDescr2:"); + goto Fail; Fail: - Serial.println(rcode, HEX); - Release(); - return rcode; + Serial.println(rcode, HEX); + Release(); + return rcode; } USBHost usb; @@ -62,16 +62,16 @@ void setup() Serial.println("Start"); if (usb.Init() == -1) - Serial.println("OSC did not start."); + Serial.println("OSC did not start."); delay( 200 ); if (!Hid.SetReportParser(0, &Uni)) - ErrorMessage(PSTR("SetReportParser"), 1 ); + ErrorMessage(PSTR("SetReportParser"), 1 ); } void loop() { - usb.Task(); + usb.Task(); } diff --git a/examples/HID/le3dp/le3dp.ino b/examples/HID/le3dp/le3dp.ino index 70fa0ec8..d3626080 100644 --- a/examples/HID/le3dp/le3dp.ino +++ b/examples/HID/le3dp/le3dp.ino @@ -27,16 +27,16 @@ void setup() Serial.println("Start"); if (usb.Init() == -1) - Serial.println("OSC did not start."); + Serial.println("OSC did not start."); delay( 200 ); if (!Hid.SetReportParser(0, &Joy)) - ErrorMessage(PSTR("SetReportParser"), 1 ); + ErrorMessage(PSTR("SetReportParser"), 1 ); } void loop() { - usb.Task(); + usb.Task(); } diff --git a/examples/HID/scale/scale.ino b/examples/HID/scale/scale.ino index 4c4ad023..78024922 100644 --- a/examples/HID/scale/scale.ino +++ b/examples/HID/scale/scale.ino @@ -13,12 +13,12 @@ #include #endif -USBHost usb; -USBHub Hub(&usb); -HIDUniversal Hid(&usb); -Max_LCD LCD(&usb); -ScaleEvents ScaleEvents(&LCD); -ScaleReportParser Scale(&ScaleEvents); +USBHost usb; +USBHub Hub(&usb); +HIDUniversal Hid(&usb); +Max_LCD LCD(&usb); +ScaleEvents ScaleEvents(&LCD); +ScaleReportParser Scale(&ScaleEvents); void setup() { @@ -29,23 +29,23 @@ void setup() Serial.println("Start"); if (usb.Init() == -1) - Serial.println("OSC did not start."); + Serial.println("OSC did not start."); - // set up the LCD's number of rows and columns: - LCD.begin(16, 2); - LCD.clear(); - LCD.home(); - LCD.setCursor(0,0); - LCD.write('R'); + // set up the LCD's number of rows and columns: + LCD.begin(16, 2); + LCD.clear(); + LCD.home(); + LCD.setCursor(0, 0); + LCD.write('R'); delay( 200 ); if (!Hid.SetReportParser(0, &Scale)) - ErrorMessage(PSTR("SetReportParser"), 1 ); + ErrorMessage(PSTR("SetReportParser"), 1 ); } void loop() { - usb.Task(); + usb.Task(); } diff --git a/examples/adk/adk_barcode/adk_barcode.ino b/examples/adk/adk_barcode/adk_barcode.ino index eceff29c..61a66f9d 100644 --- a/examples/adk/adk_barcode/adk_barcode.ino +++ b/examples/adk/adk_barcode/adk_barcode.ino @@ -12,48 +12,48 @@ #endif USBHost usb; -USBHub Hub1(&usb); -USBHub Hub2(&usb); +USBHub Hub1(&usb); +USBHub Hub2(&usb); HIDBoot HidKeyboard(&usb); -ADK adk(&usb,"Circuits@Home, ltd.", - "USBHost Host Shield", - "Arduino Terminal for Android", - "1.0", - "http://www.circuitsathome.com", - "0000000000000001"); +ADK adk(&usb, "Circuits@Home, ltd.", + "USBHost Host Shield", + "Arduino Terminal for Android", + "1.0", + "http://www.circuitsathome.com", + "0000000000000001"); class KbdRptParser : public KeyboardReportParser { protected: - void OnKeyDown (uint8_t mod, uint8_t key); - void OnKeyPressed(uint8_t key); + void OnKeyDown(uint8_t mod, uint8_t key); + void OnKeyPressed(uint8_t key); }; void KbdRptParser::OnKeyDown(uint8_t mod, uint8_t key) { - uint8_t c = OemToAscii(mod, key); + uint8_t c = OemToAscii(mod, key); - if (c) - OnKeyPressed(c); + if (c) + OnKeyPressed(c); } /* what to do when symbol arrives */ void KbdRptParser::OnKeyPressed(uint8_t key) { -const char* new_line = "\n"; -uint8_t rcode; -uint8_t keylcl; + const char* new_line = "\n"; + uint8_t rcode; + uint8_t keylcl; - if( adk.isReady() == false ) { - return; - } + if ( adk.isReady() == false ) { + return; + } keylcl = key; - if( keylcl == 0x13 ) { + if ( keylcl == 0x13 ) { rcode = adk.SndData( strlen( new_line ), (uint8_t *)new_line ); } else { @@ -77,7 +77,7 @@ void setup() if (usb.Init() == -1) { Serial.println("OSCOKIRQ failed to assert"); - while(1); //halt + while (1); //halt }//if (usb.Init() == -1... HidKeyboard.SetReportParser(0, (HIDReportParser*)&Prs); diff --git a/examples/hub_demo/hub_demo.ino b/examples/hub_demo/hub_demo.ino index 6e0c8f02..85a9d4fd 100644 --- a/examples/hub_demo/hub_demo.ino +++ b/examples/hub_demo/hub_demo.ino @@ -7,7 +7,7 @@ #include #endif -USBHost usb; +USBHost usb; USBHub Hub1(&usb); USBHub Hub2(&usb); USBHub Hub3(&usb);