File tree Expand file tree Collapse file tree 5 files changed +12
-14
lines changed
arduino-core/src/cc/arduino
hardware/arduino/avr/libraries/HID Expand file tree Collapse file tree 5 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -549,13 +549,11 @@ public void message(String s) {
549549 }
550550
551551 if (error .trim ().equals ("'Mouse' was not declared in this scope" )) {
552- error = tr ("'Mouse' only supported on the Arduino Leonardo" );
553- //msg = _("\nThe 'Mouse' class is only supported on the Arduino Leonardo.\n\n");
552+ error = tr ("'Mouse' not found. Have you included \" Mouse.h\" ? Does your board support it?" );
554553 }
555554
556555 if (error .trim ().equals ("'Keyboard' was not declared in this scope" )) {
557- error = tr ("'Keyboard' only supported on the Arduino Leonardo" );
558- //msg = _("\nThe 'Keyboard' class is only supported on the Arduino Leonardo.\n\n");
556+ error = tr ("'Keyboard' not found. Have you included \" Keyboard.h\" ? Does your board support it?" );
559557 }
560558
561559 RunnerException exception = placeException (error , pieces [1 ], PApplet .parseInt (pieces [2 ]) - 1 );
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ int HID_::getDescriptor(USBSetup& setup)
4747 if (setup.wIndex != pluggedInterface) { return 0 ; }
4848
4949 int total = 0 ;
50- HIDDescriptorListNode * node;
50+ HIDSubDescriptor * node;
5151 for (node = rootNode; node; node = node->next ) {
5252 int res = USB_SendControl (TRANSFER_PGM, node->data , node->length );
5353 if (res == -1 )
@@ -57,12 +57,12 @@ int HID_::getDescriptor(USBSetup& setup)
5757 return total;
5858}
5959
60- void HID_::AppendDescriptor (HIDDescriptorListNode *node)
60+ void HID_::AppendDescriptor (HIDSubDescriptor *node)
6161{
6262 if (!rootNode) {
6363 rootNode = node;
6464 } else {
65- HIDDescriptorListNode *current = rootNode;
65+ HIDSubDescriptor *current = rootNode;
6666 while (current->next ) {
6767 current = current->next ;
6868 }
Original file line number Diff line number Diff line change @@ -74,10 +74,10 @@ typedef struct
7474 EndpointDescriptor in;
7575} HIDDescriptor;
7676
77- class HIDDescriptorListNode {
77+ class HIDSubDescriptor {
7878public:
79- HIDDescriptorListNode *next = NULL ;
80- HIDDescriptorListNode (const void *d, const uint16_t l) : data(d), length(l) { }
79+ HIDSubDescriptor *next = NULL ;
80+ HIDSubDescriptor (const void *d, const uint16_t l) : data(d), length(l) { }
8181
8282 const void * data;
8383 const uint16_t length;
@@ -89,7 +89,7 @@ class HID_ : public PluggableUSBModule
8989 HID_ (void );
9090 int begin (void );
9191 void SendReport (uint8_t id, const void * data, int len);
92- void AppendDescriptor (HIDDescriptorListNode * node);
92+ void AppendDescriptor (HIDSubDescriptor * node);
9393
9494protected:
9595 // Implementation of the PluggableUSBModule
@@ -100,7 +100,7 @@ class HID_ : public PluggableUSBModule
100100private:
101101 uint8_t epType[1 ];
102102
103- HIDDescriptorListNode * rootNode;
103+ HIDSubDescriptor * rootNode;
104104 uint16_t descriptorSize;
105105
106106 uint8_t protocol;
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
6262
6363Keyboard_::Keyboard_ (void )
6464{
65- static HIDDescriptorListNode node (_hidReportDescriptor, sizeof (_hidReportDescriptor));
65+ static HIDSubDescriptor node (_hidReportDescriptor, sizeof (_hidReportDescriptor));
6666 HID ().AppendDescriptor (&node);
6767}
6868
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
6262
6363Mouse_::Mouse_ (void ) : _buttons(0 )
6464{
65- static HIDDescriptorListNode node (_hidReportDescriptor, sizeof (_hidReportDescriptor));
65+ static HIDSubDescriptor node (_hidReportDescriptor, sizeof (_hidReportDescriptor));
6666 HID ().AppendDescriptor (&node);
6767}
6868
You can’t perform that action at this time.
0 commit comments