From b37a8bb44cf011e02d4738a19b8b375b53eb2707 Mon Sep 17 00:00:00 2001 From: Florian Fleissner Date: Fri, 6 Dec 2019 13:15:04 +0100 Subject: [PATCH] Fixes linker order dependent choice of wrong HID library The virtual hid was recently included in the core firmware repo. Due to missing `#ifdef KALEIDOSCOPE_VIRTUAL_BUILD` in some files, two versions of the hid library, one for the virtual and one for the physical device were build. The linker perferred the one that it encountered first. That caused a link order dependency that possibly renders some firmware builds without HID reports being send to the host. This change adds thse missing `#ifdef KALEIDOSCOPE_VIRTUAL_BUILD` clauses. Signed-off-by: Florian Fleissner --- src/kaleidoscope/device/virtual/HID.cpp | 4 ++++ src/kaleidoscope/device/virtual/Logging.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/kaleidoscope/device/virtual/HID.cpp b/src/kaleidoscope/device/virtual/HID.cpp index cf751f3f..c7faea2a 100644 --- a/src/kaleidoscope/device/virtual/HID.cpp +++ b/src/kaleidoscope/device/virtual/HID.cpp @@ -16,6 +16,8 @@ SOFTWARE. */ +#ifdef KALEIDOSCOPE_VIRTUAL_BUILD + // This is a modified version of the original HID.cpp from // library KeyboardioHID. It replaces all hardware related stuff // with stub implementations. @@ -92,3 +94,5 @@ int HID_::begin(void) { } #endif /* if defined(USBCON) */ + +#endif // #ifdef KALEIDOSCOPE_VIRTUAL_BUILD diff --git a/src/kaleidoscope/device/virtual/Logging.cpp b/src/kaleidoscope/device/virtual/Logging.cpp index 2acecbbc..d4a87839 100644 --- a/src/kaleidoscope/device/virtual/Logging.cpp +++ b/src/kaleidoscope/device/virtual/Logging.cpp @@ -14,6 +14,8 @@ * this program. If not, see . */ +#ifdef KALEIDOSCOPE_VIRTUAL_BUILD + #include "Logging.h" namespace kaleidoscope { @@ -31,3 +33,5 @@ bool verboseOutputEnabled() { } // namespace logging } // namespace kaleidoscope + +#endif // #ifdef KALEIDOSCOPE_VIRTUAL_BUILD