hardware: Vendorize the ErgoDox and the Model01 ports

Like the Atreus and the Planck, these should be in vendor namespaces too.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
pull/471/head
Gergely Nagy 6 years ago
parent 75dd28aeab
commit 827dc52d76
No known key found for this signature in database
GPG Key ID: AC1E90BAC433F68F

@ -17,4 +17,4 @@
*/ */
#pragma once #pragma once
#include "kaleidoscope/hardware/ErgoDox.h" #include "kaleidoscope/hardware/ez/ErgoDox.h"

@ -17,4 +17,4 @@
#pragma once #pragma once
#include "kaleidoscope/hardware/Model01.h" #include "kaleidoscope/hardware/keyboardio/Model01.h"

@ -29,10 +29,11 @@
#include <Kaleidoscope.h> #include <Kaleidoscope.h>
#include <KeyboardioHID.h> #include <KeyboardioHID.h>
#include <avr/wdt.h> #include <avr/wdt.h>
#include "kaleidoscope/hardware/ErgoDox/ErgoDoxScanner.h" #include "kaleidoscope/hardware/ez/ErgoDox/ErgoDoxScanner.h"
namespace kaleidoscope { namespace kaleidoscope {
namespace hardware { namespace hardware {
namespace ez {
ErgoDoxScanner ErgoDox::scanner_; ErgoDoxScanner ErgoDox::scanner_;
uint8_t ErgoDox::previousKeyState_[ROWS]; uint8_t ErgoDox::previousKeyState_[ROWS];
@ -245,10 +246,11 @@ uint8_t ErgoDox::pressedKeyswitchCount() {
return count; return count;
} }
}
} }
} }
HARDWARE_IMPLEMENTATION KeyboardHardware; HARDWARE_IMPLEMENTATION KeyboardHardware;
kaleidoscope::hardware::ErgoDox &ErgoDox = KeyboardHardware; kaleidoscope::hardware::ez::ErgoDox &ErgoDox = KeyboardHardware;
#endif #endif

@ -29,9 +29,9 @@
#include <Arduino.h> #include <Arduino.h>
#include "kaleidoscope/hardware/ErgoDox/ErgoDoxScanner.h" #include "kaleidoscope/hardware/ez/ErgoDox/ErgoDoxScanner.h"
#define HARDWARE_IMPLEMENTATION kaleidoscope::hardware::ErgoDox #define HARDWARE_IMPLEMENTATION kaleidoscope::hardware::ez::ErgoDox
#include "Kaleidoscope-HIDAdaptor-KeyboardioHID.h" #include "Kaleidoscope-HIDAdaptor-KeyboardioHID.h"
#include "kaleidoscope/macro_helpers.h" #include "kaleidoscope/macro_helpers.h"
@ -44,6 +44,7 @@ struct cRGB {
namespace kaleidoscope { namespace kaleidoscope {
namespace hardware { namespace hardware {
namespace ez {
class ErgoDox { class ErgoDox {
public: public:
@ -186,9 +187,10 @@ class ErgoDox {
} }
} }
} }
}
#include "kaleidoscope/hardware/key_indexes.h" #include "kaleidoscope/hardware/key_indexes.h"
extern kaleidoscope::hardware::ErgoDox &ErgoDox; extern kaleidoscope::hardware::ez::ErgoDox &ErgoDox;
#endif #endif

@ -25,9 +25,9 @@
#ifdef ARDUINO_AVR_ERGODOX #ifdef ARDUINO_AVR_ERGODOX
#include "kaleidoscope/hardware/ErgoDox/ErgoDoxScanner.h" #include "kaleidoscope/hardware/ez/ErgoDox/ErgoDoxScanner.h"
#include <avr/wdt.h> #include <avr/wdt.h>
#include "kaleidoscope/hardware/ErgoDox/i2cmaster.h" #include "kaleidoscope/hardware/ez/ErgoDox/i2cmaster.h"
#define I2C_ADDR 0b0100000 #define I2C_ADDR 0b0100000
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE ) #define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
@ -43,6 +43,7 @@
namespace kaleidoscope { namespace kaleidoscope {
namespace hardware { namespace hardware {
namespace ez {
uint8_t ErgoDoxScanner::initExpander() { uint8_t ErgoDoxScanner::initExpander() {
uint8_t status = 0x20; uint8_t status = 0x20;
@ -200,6 +201,7 @@ ErgoDoxScanner::reattachExpanderOnError() {
start_time = millis(); start_time = millis();
} }
}
} }
} }

@ -31,6 +31,7 @@
namespace kaleidoscope { namespace kaleidoscope {
namespace hardware { namespace hardware {
namespace ez {
class ErgoDoxScanner { class ErgoDoxScanner {
public: public:
@ -50,6 +51,7 @@ class ErgoDoxScanner {
uint8_t initExpander(); uint8_t initExpander();
}; };
}
} }
} }

@ -12,7 +12,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <compat/twi.h> #include <compat/twi.h>
#include "kaleidoscope/hardware/ErgoDox/i2cmaster.h" #include "kaleidoscope/hardware/ez/ErgoDox/i2cmaster.h"
/* define CPU frequency in Mhz here if not defined in Makefile */ /* define CPU frequency in Mhz here if not defined in Makefile */

@ -23,6 +23,7 @@
namespace kaleidoscope { namespace kaleidoscope {
namespace hardware { namespace hardware {
namespace keyboardio {
KeyboardioScanner Model01::leftHand(0); KeyboardioScanner Model01::leftHand(0);
KeyboardioScanner Model01::rightHand(3); KeyboardioScanner Model01::rightHand(3);
@ -316,6 +317,7 @@ uint8_t Model01::pressedKeyswitchCount() {
return __builtin_popcountl(leftHandState.all) + __builtin_popcountl(rightHandState.all); return __builtin_popcountl(leftHandState.all) + __builtin_popcountl(rightHandState.all);
} }
}
} }
} }

@ -21,7 +21,7 @@
#include <Arduino.h> #include <Arduino.h>
#define HARDWARE_IMPLEMENTATION kaleidoscope::hardware::Model01 #define HARDWARE_IMPLEMENTATION kaleidoscope::hardware::keyboardio::Model01
#include "Kaleidoscope-HIDAdaptor-KeyboardioHID.h" #include "Kaleidoscope-HIDAdaptor-KeyboardioHID.h"
#include "KeyboardioScanner.h" #include "KeyboardioScanner.h"
@ -31,6 +31,7 @@
namespace kaleidoscope { namespace kaleidoscope {
namespace hardware { namespace hardware {
namespace keyboardio {
class Model01 { class Model01 {
public: public:
@ -134,6 +135,7 @@ class Model01 {
static keydata_t rightHandMask; static keydata_t rightHandMask;
}; };
}
} }
} }
Loading…
Cancel
Save