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 <algernon@keyboard.io>
pull/1060/head
Gergely Nagy 4 years ago
parent 80e414ace8
commit 2305f49680
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -26,6 +26,7 @@
#define CRGB(r,g,b) (cRGB){b, g, r} #define CRGB(r,g,b) (cRGB){b, g, r}
#include "kaleidoscope/driver/keyscanner/Base.h" #include "kaleidoscope/driver/keyscanner/Base.h"
#include "kaleidoscope/driver/hid/Keyboardio.h"
#include "kaleidoscope/driver/led/Base.h" #include "kaleidoscope/driver/led/Base.h"
#include "kaleidoscope/driver/bootloader/samd/Bossac.h" #include "kaleidoscope/driver/bootloader/samd/Bossac.h"
#include "kaleidoscope/driver/storage/Flash.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 RaiseSideFlasherProps : public kaleidoscope::util::flasher::BaseProps {};
struct RaiseProps : kaleidoscope::device::BaseProps { struct RaiseProps : kaleidoscope::device::BaseProps {
typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps;
typedef kaleidoscope::driver::hid::Keyboardio<HIDProps> HID;
typedef RaiseLEDDriverProps LEDDriverProps; typedef RaiseLEDDriverProps LEDDriverProps;
typedef RaiseLEDDriver LEDDriver; typedef RaiseLEDDriver LEDDriver;
typedef RaiseKeyScannerProps KeyScannerProps; typedef RaiseKeyScannerProps KeyScannerProps;

@ -23,6 +23,7 @@
#include "kaleidoscope/device/Base.h" #include "kaleidoscope/device/Base.h"
#include "kaleidoscope/driver/mcu/ATmega32U4.h" #include "kaleidoscope/driver/mcu/ATmega32U4.h"
#include "kaleidoscope/driver/hid/Keyboardio.h"
#include "kaleidoscope/driver/keyscanner/ATmega.h" #include "kaleidoscope/driver/keyscanner/ATmega.h"
#include "kaleidoscope/driver/storage/ATmega32U4EEPROMProps.h" #include "kaleidoscope/driver/storage/ATmega32U4EEPROMProps.h"
#include "kaleidoscope/driver/storage/AVREEPROM.h" #include "kaleidoscope/driver/storage/AVREEPROM.h"
@ -31,6 +32,8 @@ namespace kaleidoscope {
namespace device { namespace device {
struct ATmega32U4KeyboardProps : kaleidoscope::device::BaseProps { struct ATmega32U4KeyboardProps : kaleidoscope::device::BaseProps {
typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps;
typedef kaleidoscope::driver::hid::Keyboardio<HIDProps> HID;
typedef kaleidoscope::driver::mcu::ATmega32U4Props MCUProps; typedef kaleidoscope::driver::mcu::ATmega32U4Props MCUProps;
typedef kaleidoscope::driver::mcu::ATmega32U4<MCUProps> MCU; typedef kaleidoscope::driver::mcu::ATmega32U4<MCUProps> MCU;
typedef kaleidoscope::driver::storage::ATmega32U4EEPROMProps StorageProps; typedef kaleidoscope::driver::storage::ATmega32U4EEPROMProps StorageProps;

@ -25,7 +25,7 @@
#include "kaleidoscope_internal/deprecations.h" #include "kaleidoscope_internal/deprecations.h"
#include "kaleidoscope/macro_helpers.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/keyscanner/None.h"
#include "kaleidoscope/driver/led/None.h" #include "kaleidoscope/driver/led/None.h"
#include "kaleidoscope/driver/mcu/None.h" #include "kaleidoscope/driver/mcu/None.h"
@ -53,8 +53,8 @@ namespace kaleidoscope {
namespace device { namespace device {
struct BaseProps { struct BaseProps {
typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps; typedef kaleidoscope::driver::hid::BaseProps HIDProps;
typedef kaleidoscope::driver::hid::Keyboardio<HIDProps> HID; typedef kaleidoscope::driver::hid::Base<HIDProps> HID;
typedef kaleidoscope::driver::keyscanner::BaseProps KeyScannerProps; typedef kaleidoscope::driver::keyscanner::BaseProps KeyScannerProps;
typedef kaleidoscope::driver::keyscanner::None KeyScanner; typedef kaleidoscope::driver::keyscanner::None KeyScanner;
typedef kaleidoscope::driver::led::BaseProps LEDDriverProps; typedef kaleidoscope::driver::led::BaseProps LEDDriverProps;

@ -22,6 +22,7 @@
#include KALEIDOSCOPE_HARDWARE_H #include KALEIDOSCOPE_HARDWARE_H
#include "kaleidoscope/driver/bootloader/None.h" #include "kaleidoscope/driver/bootloader/None.h"
#include "kaleidoscope/driver/hid/Keyboardio.h"
#include "kaleidoscope/driver/led/Base.h" #include "kaleidoscope/driver/led/Base.h"
namespace kaleidoscope { namespace kaleidoscope {
@ -110,6 +111,8 @@ class VirtualLEDDriver
// the physical keyboard. // the physical keyboard.
// //
struct VirtualProps : public kaleidoscope::DeviceProps { struct VirtualProps : public kaleidoscope::DeviceProps {
typedef kaleidoscope::driver::hid::KeyboardioProps HIDProps;
typedef kaleidoscope::driver::hid::Keyboardio<HIDProps> HID;
typedef typename kaleidoscope::DeviceProps::KeyScannerProps typedef typename kaleidoscope::DeviceProps::KeyScannerProps
KeyScannerProps; KeyScannerProps;
typedef VirtualKeyScanner typedef VirtualKeyScanner

Loading…
Cancel
Save