From 0cfea03e34d3e12262b42fb373b6baa7f73ad9b1 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Mon, 15 Oct 2018 23:49:02 +0200 Subject: [PATCH] Further source code rearrangement Moved all files but `LEDControl.c` and `LEDControl.h` to `src/kaleidoscope/plugin/LEDControl`, to not pollute the `kaleidoscope/plugin` directory needlessly, with headers that should not be explicitly included. Also updated the documentation and the warnings emitted to make it clear that the use of `LED-Off.h` and `LEDUtils.h` is deprecated in favour of just using ``. Signed-off-by: Gergely Nagy --- doc/plugin/LEDControl.md | 10 ++++------ src/Kaleidoscope-LEDControl.h | 4 ++-- src/LED-Off.h | 4 ++-- src/LEDUtils.h | 4 ++-- .../plugin/{ => LEDControl}/BootAnimation.cpp | 2 +- .../plugin/{ => LEDControl}/BootAnimation.h | 0 src/kaleidoscope/plugin/{ => LEDControl}/LED-Off.cpp | 2 +- src/kaleidoscope/plugin/{ => LEDControl}/LED-Off.h | 0 src/kaleidoscope/plugin/{ => LEDControl}/LEDUtils.cpp | 2 +- src/kaleidoscope/plugin/{ => LEDControl}/LEDUtils.h | 0 10 files changed, 13 insertions(+), 15 deletions(-) rename src/kaleidoscope/plugin/{ => LEDControl}/BootAnimation.cpp (96%) rename src/kaleidoscope/plugin/{ => LEDControl}/BootAnimation.h (100%) rename src/kaleidoscope/plugin/{ => LEDControl}/LED-Off.cpp (94%) rename src/kaleidoscope/plugin/{ => LEDControl}/LED-Off.h (100%) rename src/kaleidoscope/plugin/{ => LEDControl}/LEDUtils.cpp (98%) rename src/kaleidoscope/plugin/{ => LEDControl}/LEDUtils.h (100%) diff --git a/doc/plugin/LEDControl.md b/doc/plugin/LEDControl.md index 94d00998..2a99e8d2 100644 --- a/doc/plugin/LEDControl.md +++ b/doc/plugin/LEDControl.md @@ -7,13 +7,11 @@ effects. ## Upgrading -The `LEDUtils.h` and `LED-Off.h` headers were moved, and need a -`kaleidoscope/plugin/` prefix now. The old headers still work, but are -deprecated, and will emit a warning. Both of them are included by -`` by default, so instead of migrating to the new -paths, one might wish to simply drop them instead. +The `LEDUtils.h` and `LED-Off.h` headers are now included by default when using +``, and their explicit use is therefore deprecated. +The includes can be safely removed. -The compatibility headers will be removed by 2019-01-14. +Compatibility headers are in place for both, but will be removed by 2019-01-14. Furthermore, to implement LED modes, one should use `kaleidoscope::plugin::LEDMode` as a base class now, instead of the former diff --git a/src/Kaleidoscope-LEDControl.h b/src/Kaleidoscope-LEDControl.h index cfdde64d..3564aa5a 100644 --- a/src/Kaleidoscope-LEDControl.h +++ b/src/Kaleidoscope-LEDControl.h @@ -17,5 +17,5 @@ #pragma once #include -#include -#include +#include +#include diff --git a/src/LED-Off.h b/src/LED-Off.h index 87c65ddc..eeb13372 100644 --- a/src/LED-Off.h +++ b/src/LED-Off.h @@ -16,6 +16,6 @@ #pragma once -#warning Please migrate to including "kaleidoscope/plugin/LED-Off.h" instead of "LED-Off.h", or even consider dropping the include, because will pull the right header in anyway. +#warning The "LED-Off.h" header is deprecated, the mode is included by default when using . It can be safely removed. -#include "kaleidoscope/plugin/LED-Off.h" +#include "kaleidoscope/plugin/LEDControl/LED-Off.h" diff --git a/src/LEDUtils.h b/src/LEDUtils.h index 9a0c31fc..803e882e 100644 --- a/src/LEDUtils.h +++ b/src/LEDUtils.h @@ -16,6 +16,6 @@ #pragma once -#warning Please migrate to including "kaleidoscope/plugin/LEDUtils.h" instead of "LEDUtils.h", or even consider dropping the include, because will pull the right header in anyway. +#warning The "LEDUtils.h" header is deprecated, the mode is included by default when using . It can be safely removed. -#include "kaleidoscope/plugin/LEDUtils.h" +#include "kaleidoscope/plugin/LEDControl/LEDUtils.h" diff --git a/src/kaleidoscope/plugin/BootAnimation.cpp b/src/kaleidoscope/plugin/LEDControl/BootAnimation.cpp similarity index 96% rename from src/kaleidoscope/plugin/BootAnimation.cpp rename to src/kaleidoscope/plugin/LEDControl/BootAnimation.cpp index 15e52360..2e7c0ba7 100644 --- a/src/kaleidoscope/plugin/BootAnimation.cpp +++ b/src/kaleidoscope/plugin/LEDControl/BootAnimation.cpp @@ -14,7 +14,7 @@ * this program. If not, see . */ -#include "kaleidoscope/plugin/BootAnimation.h" +#include "kaleidoscope/plugin/LEDControl/BootAnimation.h" #include "Kaleidoscope-LEDControl.h" #ifdef ARDUINO_AVR_MODEL01 diff --git a/src/kaleidoscope/plugin/BootAnimation.h b/src/kaleidoscope/plugin/LEDControl/BootAnimation.h similarity index 100% rename from src/kaleidoscope/plugin/BootAnimation.h rename to src/kaleidoscope/plugin/LEDControl/BootAnimation.h diff --git a/src/kaleidoscope/plugin/LED-Off.cpp b/src/kaleidoscope/plugin/LEDControl/LED-Off.cpp similarity index 94% rename from src/kaleidoscope/plugin/LED-Off.cpp rename to src/kaleidoscope/plugin/LEDControl/LED-Off.cpp index 98ec730f..175ccab1 100644 --- a/src/kaleidoscope/plugin/LED-Off.cpp +++ b/src/kaleidoscope/plugin/LEDControl/LED-Off.cpp @@ -14,7 +14,7 @@ * this program. If not, see . */ -#include "kaleidoscope/plugin/LED-Off.h" +#include "kaleidoscope/plugin/LEDControl/LED-Off.h" namespace kaleidoscope { namespace plugin { diff --git a/src/kaleidoscope/plugin/LED-Off.h b/src/kaleidoscope/plugin/LEDControl/LED-Off.h similarity index 100% rename from src/kaleidoscope/plugin/LED-Off.h rename to src/kaleidoscope/plugin/LEDControl/LED-Off.h diff --git a/src/kaleidoscope/plugin/LEDUtils.cpp b/src/kaleidoscope/plugin/LEDControl/LEDUtils.cpp similarity index 98% rename from src/kaleidoscope/plugin/LEDUtils.cpp rename to src/kaleidoscope/plugin/LEDControl/LEDUtils.cpp index 873e4cb1..9f7f9c83 100644 --- a/src/kaleidoscope/plugin/LEDUtils.cpp +++ b/src/kaleidoscope/plugin/LEDControl/LEDUtils.cpp @@ -14,7 +14,7 @@ * this program. If not, see . */ -#include "kaleidoscope/plugin/LEDUtils.h" +#include "kaleidoscope/plugin/LEDControl/LEDUtils.h" cRGB breath_compute(uint8_t hue, uint8_t saturation) { diff --git a/src/kaleidoscope/plugin/LEDUtils.h b/src/kaleidoscope/plugin/LEDControl/LEDUtils.h similarity index 100% rename from src/kaleidoscope/plugin/LEDUtils.h rename to src/kaleidoscope/plugin/LEDControl/LEDUtils.h