Rearrange the file layout in preparation of becoming a monorepo

Move the documentation to `doc/plugin/LEDEffect-SolidColor.md`, sources under
`src/kaleidoscope/plugin/` (appropriately namespaced). This is in preparation of
merging plugins into a single monorepo.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/365/head
Gergely Nagy 6 years ago
parent eb30c1d30d
commit 3a7be52642
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -5,26 +5,4 @@
[travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-LEDEffect-SolidColor.svg?branch=master
[travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-LEDEffect-SolidColor
This plugin provides tools to build LED effects that set the entire keyboard to
a single color. For show, and for backlighting purposes.
## Using the extension
To use the plugin, include the header, declare an effect using the
`LEDSolidColor` class, and tell the firmware to use the new effect:
```c++
#include <Kaleidoscope-LEDEffect-SolidColor.h>
static LEDSolidColor solidRed(160, 0, 0);
KALEIDOSCOPE_INIT_PLUGINS(LEDControl, solidRed);
void setup() {
Kaleidoscope.setup();
}
```
## Dependencies
* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl)
See [doc/plugin/LEDEffect-SolidColor.md](doc/plugin/LEDEffect-SolidColor.md) for documentation.

@ -0,0 +1,33 @@
# Kaleidoscope-LEDEffect-SolidColor
This plugin provides tools to build LED effects that set the entire keyboard to
a single color. For show, and for backlighting purposes.
## Using the extension
To use the plugin, include the header, declare an effect using the
`kaleidoscope::plugin::LEDSolidColor` class, and tell the firmware to use the
new effect:
```c++
#include <Kaleidoscope-LEDEffect-SolidColor.h>
static kaleidoscope::plugin::LEDSolidColor solidRed(160, 0, 0);
KALEIDOSCOPE_INIT_PLUGINS(LEDControl, solidRed);
void setup() {
Kaleidoscope.setup();
}
```
## Dependencies
* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl)
## Upgrading
Previous versions of `LEDEffect-SolidColor` used `kaleidoscope::LEDSolidColor`
as a class for defining solid-color effects. This is called
`kaleidoscope::plugin::LEDSolidColor` now. The old name still works, but is
deprecated, and will be removed by 2019-01-14.

@ -16,18 +16,4 @@
#pragma once
#include "Kaleidoscope-LEDControl.h"
namespace kaleidoscope {
class LEDSolidColor : public LEDMode {
public:
LEDSolidColor(uint8_t r, uint8_t g, uint8_t b);
protected:
void onActivate(void) final;
void refreshAt(byte row, byte col) final;
private:
uint8_t r, g, b;
};
}
#include "kaleidoscope/plugin/LEDEffect-SolidColor.h"

@ -17,6 +17,7 @@
#include "Kaleidoscope-LEDEffect-SolidColor.h"
namespace kaleidoscope {
namespace plugin {
LEDSolidColor::LEDSolidColor(uint8_t r, uint8_t g, uint8_t b) {
this->r = r;
this->g = g;
@ -30,4 +31,6 @@ void LEDSolidColor::onActivate(void) {
void LEDSolidColor::refreshAt(byte row, byte col) {
::LEDControl.setCrgbAt(row, col, CRGB(r, g, b));
}
}
}

@ -0,0 +1,39 @@
/* Kaleidoscope-LEDEffect-SolidColor - Solid color LED effects for Kaleidoscope.
* Copyright (C) 2017 Keyboard.io, Inc.
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, version 3.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "Kaleidoscope-LEDControl.h"
namespace kaleidoscope {
namespace plugin {
class LEDSolidColor : public LEDMode {
public:
LEDSolidColor(uint8_t r, uint8_t g, uint8_t b);
protected:
void onActivate(void) final;
void refreshAt(byte row, byte col) final;
private:
uint8_t r, g, b;
};
}
// Backwards compatibility
typedef plugin::LEDSolidColor LEDSolidColor;
}
Loading…
Cancel
Save