Skip to content

Commit 288c250

Browse files
facchinmcmaglie
authored andcommitted
[PUSB] Fix static initialization order fiasco
For details see: https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use
1 parent 90985d3 commit 288c250

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/Keyboard.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static const uint8_t _hidReportDescriptor[] PROGMEM = {
6363
Keyboard_::Keyboard_(void)
6464
{
6565
static HIDDescriptorListNode node(_hidReportDescriptor, sizeof(_hidReportDescriptor));
66-
HID.AppendDescriptor(&node);
66+
HID().AppendDescriptor(&node);
6767
}
6868

6969
void Keyboard_::begin(void)
@@ -76,7 +76,7 @@ void Keyboard_::end(void)
7676

7777
void Keyboard_::sendReport(KeyReport* keys)
7878
{
79-
HID.SendReport(2,keys,sizeof(KeyReport));
79+
HID().SendReport(2,keys,sizeof(KeyReport));
8080
}
8181

8282
extern

src/Keyboard.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class Keyboard_ : public Print
9494
void releaseAll(void);
9595
};
9696
extern Keyboard_ Keyboard;
97-
extern HID_ HID;
9897

9998
#endif
10099
#endif

0 commit comments

Comments
 (0)