Skip to content

Commit 9b3c571

Browse files
committed
Fix HID porting
1 parent a3c971c commit 9b3c571

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

cores/arduino/USB/USBCore.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -979,12 +979,16 @@ void USBDeviceClass::ISRHandler()
979979
}
980980
}
981981

982-
/*
983-
* USB Device instance
984-
* -------------------
985-
*/
982+
// PluggableUSB contructor
983+
PluggableUSB_::PluggableUSB_() : lastIf(CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT),
984+
lastEp(CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT),
985+
rootNode(NULL), totalEP(USB_ENDPOINTS)
986+
{
987+
// Empty
988+
}
986989

987-
// USBDevice class instance
988-
USBDeviceClass USBDevice;
990+
void* epBuffer(unsigned int lastEp) {
991+
return &(EndPoints[lastEp]);
992+
}
989993

990994
#endif

libraries/HID/HID.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@
1616
** SOFTWARE.
1717
*/
1818

19-
#include "USB/PluggableUSB.h"
19+
#include "api/PluggableUSB.h"
2020
#include "HID.h"
2121

2222
#if defined(USBCON)
2323

24+
extern USBDeviceClass USBDevice;
25+
2426
HID_& HID()
2527
{
2628
static HID_ obj;

libraries/HID/HID.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include <stdint.h>
2323
#include <Arduino.h>
24-
#include "USB/PluggableUSB.h"
24+
#include "api/PluggableUSB.h"
2525

2626
#if defined(USBCON)
2727

@@ -99,7 +99,7 @@ class HID_ : public PluggableUSBModule
9999
uint8_t getShortName(char* name);
100100

101101
private:
102-
uint32_t epType[1];
102+
unsigned int epType[1];
103103

104104
HIDSubDescriptor* rootNode;
105105
uint16_t descriptorSize;

0 commit comments

Comments
 (0)