2 #include <hiduniversal.h>
3 #include <hidescriptorparser.h>
5 #include "pgmstrings.h"
7 // Satisfy the IDE, which needs to see the include statment in the ino too.
9 #include <spi4teensy3.h>
13 class HIDUniversal2 : public HIDUniversal
16 HIDUniversal2(USB *usb) : HIDUniversal(usb) {};
19 uint8_t OnInitSuccessful();
22 uint8_t HIDUniversal2::OnInitSuccessful()
26 HexDumper<USBReadParser, uint16_t, uint16_t> Hex;
29 if ((rcode = GetReportDescr(0, &Hex)))
30 goto FailGetReportDescr1;
32 if ((rcode = GetReportDescr(0, &Rpt)))
33 goto FailGetReportDescr2;
38 USBTRACE("GetReportDescr1:");
42 USBTRACE("GetReportDescr2:");
46 Serial.println(rcode, HEX);
53 HIDUniversal2 Hid(&Usb);
54 UniversalReportParser Uni;
58 Serial.begin( 115200 );
59 #if !defined(__MIPSEL__)
60 while (!Serial); // Wait for serial port to connect - used on Leonardo, Teensy and other boards with built-in USB CDC serial connection
62 Serial.println("Start");
65 Serial.println("OSC did not start.");
69 if (!Hid.SetReportParser(0, &Uni))
70 ErrorMessage<uint8_t>(PSTR("SetReportParser"), 1 );