From 2305f49680afc899975efb531dcc7648c85c7dc3 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 10 Jun 2021 12:47:45 +0200 Subject: [PATCH] device::Base: Use the Base HID by default, rather than KeyboardioHID To allow us to use any other HID than KeyboardioHID, the base device _must_ use something else (practically, the Base HID), otherwise we'll get a compile error when building on a platform that KeyboardioHID does not support, even if we do not use KeyboardioHID. We get that error, because the base class references it anyway. As such, lets use the base HID as default, and adjust all users of KeyboardioHID to explicitly set that: Virtual, Dygma Raise, and ATmega32U4Keyboard. Everything else derives from the last one, so they're covered with just the change to ATmega32U4Keyboard. Signed-off-by: Gergely Nagy --- .../src/kaleidoscope/device/dygma/Raise.h | 3 +++ src/kaleidoscope/device/ATmega32U4Keyboard.h | 3 +++ src/kaleidoscope/device/Base.h | 6 +++--- src/kaleidoscope/device/virtual/Virtual.h | 3 +++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h b/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h index 80f1e5ed..28beb92b 100644 --- a/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h +++ b/plugins/Kaleidoscope-Hardware-Dygma-Raise/src/kaleidoscope/device/dygma/Raise.h @@ -26,6 +26,7 @@ #define CRGB(r,g,b) (cRGB){b, g, r} #include "kaleidoscope/driver/keyscanner/Base.h" +#include "kaleidoscope/driver/hid/Keyboardio.h" #include "kaleidoscope/driver/led/Base.h" #include "kaleidoscope/driver/bootloader/samd/Bossac.h" #include "kaleidoscope/driver/storage/Flash.h" @@ -156,6 +157,8 @@ struct RaiseStorageProps : public kaleidoscope::driver::storage::FlashProps { struct RaiseSideFlasherProps : public kaleidoscope::util::flasher::BaseProps {}; struct RaiseProps : kaleidoscope::device::BaseProps { + typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps; + typedef kaleidoscope::driver::hid::Keyboardio HID; typedef RaiseLEDDriverProps LEDDriverProps; typedef RaiseLEDDriver LEDDriver; typedef RaiseKeyScannerProps KeyScannerProps; diff --git a/src/kaleidoscope/device/ATmega32U4Keyboard.h b/src/kaleidoscope/device/ATmega32U4Keyboard.h index b9ae02ff..f710c12d 100644 --- a/src/kaleidoscope/device/ATmega32U4Keyboard.h +++ b/src/kaleidoscope/device/ATmega32U4Keyboard.h @@ -23,6 +23,7 @@ #include "kaleidoscope/device/Base.h" #include "kaleidoscope/driver/mcu/ATmega32U4.h" +#include "kaleidoscope/driver/hid/Keyboardio.h" #include "kaleidoscope/driver/keyscanner/ATmega.h" #include "kaleidoscope/driver/storage/ATmega32U4EEPROMProps.h" #include "kaleidoscope/driver/storage/AVREEPROM.h" @@ -31,6 +32,8 @@ namespace kaleidoscope { namespace device { struct ATmega32U4KeyboardProps : kaleidoscope::device::BaseProps { + typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps; + typedef kaleidoscope::driver::hid::Keyboardio HID; typedef kaleidoscope::driver::mcu::ATmega32U4Props MCUProps; typedef kaleidoscope::driver::mcu::ATmega32U4 MCU; typedef kaleidoscope::driver::storage::ATmega32U4EEPROMProps StorageProps; diff --git a/src/kaleidoscope/device/Base.h b/src/kaleidoscope/device/Base.h index 5841d780..826a1cb1 100644 --- a/src/kaleidoscope/device/Base.h +++ b/src/kaleidoscope/device/Base.h @@ -25,7 +25,7 @@ #include "kaleidoscope_internal/deprecations.h" #include "kaleidoscope/macro_helpers.h" -#include "kaleidoscope/driver/hid/Keyboardio.h" +#include "kaleidoscope/driver/hid/Base.h" #include "kaleidoscope/driver/keyscanner/None.h" #include "kaleidoscope/driver/led/None.h" #include "kaleidoscope/driver/mcu/None.h" @@ -53,8 +53,8 @@ namespace kaleidoscope { namespace device { struct BaseProps { - typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps; - typedef kaleidoscope::driver::hid::Keyboardio HID; + typedef kaleidoscope::driver::hid::BaseProps HIDProps; + typedef kaleidoscope::driver::hid::Base HID; typedef kaleidoscope::driver::keyscanner::BaseProps KeyScannerProps; typedef kaleidoscope::driver::keyscanner::None KeyScanner; typedef kaleidoscope::driver::led::BaseProps LEDDriverProps; diff --git a/src/kaleidoscope/device/virtual/Virtual.h b/src/kaleidoscope/device/virtual/Virtual.h index 9bc576fc..a6ea731f 100644 --- a/src/kaleidoscope/device/virtual/Virtual.h +++ b/src/kaleidoscope/device/virtual/Virtual.h @@ -22,6 +22,7 @@ #include KALEIDOSCOPE_HARDWARE_H #include "kaleidoscope/driver/bootloader/None.h" +#include "kaleidoscope/driver/hid/Keyboardio.h" #include "kaleidoscope/driver/led/Base.h" namespace kaleidoscope { @@ -110,6 +111,8 @@ class VirtualLEDDriver // the physical keyboard. // struct VirtualProps : public kaleidoscope::DeviceProps { + typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps; + typedef kaleidoscope::driver::hid::Keyboardio HID; typedef typename kaleidoscope::DeviceProps::KeyScannerProps KeyScannerProps; typedef VirtualKeyScanner