From 129d37ef0406a6ca8e792292eea1a598ececed27 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 5 Nov 2019 12:46:42 +0100 Subject: [PATCH] Deprecate named hardware objects Some boards used to provide the device object under an alias named after the device itself. For the sake of consistency, we do not want to provide these aliases in the future. As such, deprecate them, and update all users to use `KeyboardHardware` instead. Signed-off-by: Gergely Nagy --- examples/Devices/KBDFans/KBD4x/KBD4x.ino | 2 +- examples/Devices/Technomancy/Atreus/Atreus.ino | 2 +- src/kaleidoscope/device/ez/ErgoDox.h | 2 +- src/kaleidoscope/device/kbdfans/KBD4x.h | 2 +- src/kaleidoscope/device/olkb/Planck.h | 2 +- src/kaleidoscope/device/softhruf/Splitography.h | 2 +- src/kaleidoscope/device/technomancy/Atreus.h | 2 +- src/kaleidoscope/device/technomancy/Atreus2.h | 2 +- src/kaleidoscope_internal/deprecations.h | 4 ++++ 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/Devices/KBDFans/KBD4x/KBD4x.ino b/examples/Devices/KBDFans/KBD4x/KBD4x.ino index b0b24974..820adbf5 100644 --- a/examples/Devices/KBDFans/KBD4x/KBD4x.ino +++ b/examples/Devices/KBDFans/KBD4x/KBD4x.ino @@ -78,7 +78,7 @@ KALEIDOSCOPE_INIT_PLUGINS(Macros); const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { switch (macroIndex) { case RESET: - KBD4x.resetDevice(); + KeyboardHardware.resetDevice(); break; default: break; diff --git a/examples/Devices/Technomancy/Atreus/Atreus.ino b/examples/Devices/Technomancy/Atreus/Atreus.ino index 373f09ac..c6380c6b 100644 --- a/examples/Devices/Technomancy/Atreus/Atreus.ino +++ b/examples/Devices/Technomancy/Atreus/Atreus.ino @@ -83,7 +83,7 @@ KALEIDOSCOPE_INIT_PLUGINS(Macros); const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) { switch (macroIndex) { case RESET: - Atreus.resetDevice(); + KeyboardHardware.resetDevice(); break; default: break; diff --git a/src/kaleidoscope/device/ez/ErgoDox.h b/src/kaleidoscope/device/ez/ErgoDox.h index 7994cee3..cc431aef 100644 --- a/src/kaleidoscope/device/ez/ErgoDox.h +++ b/src/kaleidoscope/device/ez/ErgoDox.h @@ -156,6 +156,6 @@ class ErgoDox : public kaleidoscope::Hardware { } } -extern kaleidoscope::device::ez::ErgoDox &ErgoDox; +extern kaleidoscope::device::ez::ErgoDox DEPRECATED(NAMED_HARDWARE) &ErgoDox; #endif diff --git a/src/kaleidoscope/device/kbdfans/KBD4x.h b/src/kaleidoscope/device/kbdfans/KBD4x.h index 569d1107..08b34f12 100644 --- a/src/kaleidoscope/device/kbdfans/KBD4x.h +++ b/src/kaleidoscope/device/kbdfans/KBD4x.h @@ -67,6 +67,6 @@ class KBD4x: public kaleidoscope::device::ATMegaKeyboard { } } -extern kaleidoscope::device::kbdfans::KBD4x &KBD4x; +extern kaleidoscope::device::kbdfans::KBD4x DEPRECATED(NAMED_HARDWARE) &KBD4x; #endif diff --git a/src/kaleidoscope/device/olkb/Planck.h b/src/kaleidoscope/device/olkb/Planck.h index 4a051de8..6393bf7f 100644 --- a/src/kaleidoscope/device/olkb/Planck.h +++ b/src/kaleidoscope/device/olkb/Planck.h @@ -63,6 +63,6 @@ class Planck: public kaleidoscope::device::ATMegaKeyboard { } } -extern kaleidoscope::device::olkb::Planck &Planck; +extern kaleidoscope::device::olkb::Planck DEPRECATED(NAMED_HARDWARE) &Planck; #endif diff --git a/src/kaleidoscope/device/softhruf/Splitography.h b/src/kaleidoscope/device/softhruf/Splitography.h index d31de004..9c67d080 100644 --- a/src/kaleidoscope/device/softhruf/Splitography.h +++ b/src/kaleidoscope/device/softhruf/Splitography.h @@ -88,6 +88,6 @@ class Splitography: public kaleidoscope::device::ATMegaKeyboard { } } -extern kaleidoscope::device::softhruf::Splitography &Splitography; +extern kaleidoscope::device::softhruf::Splitography DEPRECATED(NAMED_HARDWARE) &Splitography; #endif diff --git a/src/kaleidoscope/device/technomancy/Atreus.h b/src/kaleidoscope/device/technomancy/Atreus.h index b97f5f4b..535883b1 100644 --- a/src/kaleidoscope/device/technomancy/Atreus.h +++ b/src/kaleidoscope/device/technomancy/Atreus.h @@ -105,6 +105,6 @@ class Atreus: public kaleidoscope::device::ATMegaKeyboard { } } -extern kaleidoscope::device::technomancy::Atreus &Atreus; +extern kaleidoscope::device::technomancy::Atreus DEPRECATED(NAMED_HARDWARE) &Atreus; #endif diff --git a/src/kaleidoscope/device/technomancy/Atreus2.h b/src/kaleidoscope/device/technomancy/Atreus2.h index d3fbc072..e707a6e3 100644 --- a/src/kaleidoscope/device/technomancy/Atreus2.h +++ b/src/kaleidoscope/device/technomancy/Atreus2.h @@ -82,6 +82,6 @@ class Atreus2: public kaleidoscope::device::ATMegaKeyboard { } } -extern kaleidoscope::device::technomancy::Atreus2 &Atreus2; +extern kaleidoscope::device::technomancy::Atreus2 DEPRECATED(NAMED_HARDWARE) &Atreus2; #endif diff --git a/src/kaleidoscope_internal/deprecations.h b/src/kaleidoscope_internal/deprecations.h index 8e53baae..852e92c7 100644 --- a/src/kaleidoscope_internal/deprecations.h +++ b/src/kaleidoscope_internal/deprecations.h @@ -26,3 +26,7 @@ "------------------------------------------------------------------------\n" \ /* Messages */ + +#define _DEPRECATED_MESSAGE_NAMED_HARDWARE __NL__ \ + "Named hardware objects are deprecated, please use `KeyboardHardware`\n" __NL__ \ + "instead."