diff options
Diffstat (limited to 'libraries/HID/HID.h')
-rw-r--r-- | libraries/HID/HID.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/HID/HID.h b/libraries/HID/HID.h index 2cd0f4a..a7f5c68 100644 --- a/libraries/HID/HID.h +++ b/libraries/HID/HID.h @@ -93,6 +93,11 @@ private: uint8_t idle; }; +// Replacement for global singleton. +// This function prevents static-initialization-order-fiasco +// https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use +HID_& HID(); + #define D_HIDREPORT(length) { 9, 0x21, 0x01, 0x01, 0, 1, 0x22, lowByte(length), highByte(length) } #endif // USBCON |