hardware/ATMegaKeyboard: Don't hardcode the list of keyboards

Instead of guarding the ATMegaKeyboard files with an `#if` that hard-coded which
keyboards are based on the class, guard them with
`KALEIDOSCOPE_WITH_ATMEGA_KEYBOARD`, set by the main hardware headers. Those
headers get included early, and are as such, a perfect way to guard these
things.

This way if we add a new keyboard using the base class, we don't have to modify
the base class itself, and the new hardware plugin can be entirely self-contained.

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

@ -17,4 +17,6 @@
*/
#pragma once
#define KALEIDOSCOPE_WITH_ATMEGA_KEYBOARD 1
#include "kaleidoscope/hardware/olkb/Planck.h"

@ -17,4 +17,6 @@
*/
#pragma once
#define KALEIDOSCOPE_WITH_ATMEGA_KEYBOARD 1
#include "kaleidoscope/hardware/technomancy/Atreus.h"

@ -15,9 +15,10 @@
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#if ARDUINO_AVR_PLANCK || ARDUINO_AVR_ATREUS
#include "Kaleidoscope.h"
#if KALEIDOSCOPE_WITH_ATMEGA_KEYBOARD
#include "kaleidoscope/hardware/ATMegaKeyboard.h"
namespace kaleidoscope {

@ -17,7 +17,7 @@
#pragma once
#if ARDUINO_AVR_PLANCK || ARDUINO_AVR_ATREUS
#if KALEIDOSCOPE_WITH_ATMEGA_KEYBOARD
#include <Arduino.h>
#include <KeyboardioHID.h>

Loading…
Cancel
Save