From 62b164bb1f596c959d11d3cd2ed80bf6e7ee49d0 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Thu, 15 Nov 2018 21:37:05 -0800 Subject: [PATCH] Move the Atreus implementation into a vendor directory Signed-off-by: Jesse Vincent --- src/Kaleidoscope-Hardware-Technomancy-Atreus.h | 2 +- src/kaleidoscope/hardware/{ => technomancy}/Atreus.cpp | 4 +++- src/kaleidoscope/hardware/{ => technomancy}/Atreus.h | 8 +++++--- 3 files changed, 9 insertions(+), 5 deletions(-) rename src/kaleidoscope/hardware/{ => technomancy}/Atreus.cpp (95%) rename src/kaleidoscope/hardware/{ => technomancy}/Atreus.h (94%) diff --git a/src/Kaleidoscope-Hardware-Technomancy-Atreus.h b/src/Kaleidoscope-Hardware-Technomancy-Atreus.h index f098619a..f896d7ec 100644 --- a/src/Kaleidoscope-Hardware-Technomancy-Atreus.h +++ b/src/Kaleidoscope-Hardware-Technomancy-Atreus.h @@ -17,4 +17,4 @@ */ #pragma once -#include "kaleidoscope/hardware/Atreus.h" +#include "kaleidoscope/hardware/technomancy/Atreus.h" diff --git a/src/kaleidoscope/hardware/Atreus.cpp b/src/kaleidoscope/hardware/technomancy/Atreus.cpp similarity index 95% rename from src/kaleidoscope/hardware/Atreus.cpp rename to src/kaleidoscope/hardware/technomancy/Atreus.cpp index e2650833..7c7d8d5c 100644 --- a/src/kaleidoscope/hardware/Atreus.cpp +++ b/src/kaleidoscope/hardware/technomancy/Atreus.cpp @@ -32,6 +32,7 @@ namespace kaleidoscope { namespace hardware { +namespace technomancy { const int8_t Atreus::matrix_rows; const int8_t Atreus::matrix_columns; @@ -82,10 +83,11 @@ void Atreus::resetDevice() { asm volatile("jmp 0x7E00"); } +} } } HARDWARE_IMPLEMENTATION KeyboardHardware; -kaleidoscope::hardware::Atreus &Atreus = KeyboardHardware; +kaleidoscope::hardware::technomancy::Atreus &Atreus = KeyboardHardware; #endif diff --git a/src/kaleidoscope/hardware/Atreus.h b/src/kaleidoscope/hardware/technomancy/Atreus.h similarity index 94% rename from src/kaleidoscope/hardware/Atreus.h rename to src/kaleidoscope/hardware/technomancy/Atreus.h index a4ec4cbd..d8a648ef 100644 --- a/src/kaleidoscope/hardware/Atreus.h +++ b/src/kaleidoscope/hardware/technomancy/Atreus.h @@ -27,7 +27,7 @@ #ifdef ARDUINO_AVR_ATREUS #include -#define HARDWARE_IMPLEMENTATION kaleidoscope::hardware::Atreus +#define HARDWARE_IMPLEMENTATION kaleidoscope::hardware::technomancy::Atreus #include "Kaleidoscope-HIDAdaptor-KeyboardioHID.h" #include "kaleidoscope/macro_helpers.h" @@ -36,6 +36,7 @@ namespace kaleidoscope { namespace hardware { +namespace technomancy { class Atreus: public kaleidoscope::hardware::ATMegaKeyboard { public: Atreus(void) {} @@ -82,6 +83,7 @@ class Atreus: public kaleidoscope::hardware::ATMegaKeyboard { } } } +} /* To be used by the hardware implementations, `keyIndex` tells us the index of * a key, from which we can figure out the row and column as needed. The index @@ -92,11 +94,11 @@ class Atreus: public kaleidoscope::hardware::ATMegaKeyboard { * user-facing code. */ constexpr byte keyIndex(byte row, byte col) { - return row * kaleidoscope::hardware::Atreus::matrix_columns + col + 1; + return row * kaleidoscope::hardware::technomancy::Atreus::matrix_columns + col + 1; } #include "kaleidoscope/hardware/key_indexes.h" -extern kaleidoscope::hardware::Atreus &Atreus; +extern kaleidoscope::hardware::technomancy::Atreus &Atreus; #endif