Merge pull request #471 from keyboardio/hardware/vendorize

hardware: Vendorize the ErgoDox and the Model01 ports
pull/472/head
Jesse Vincent 6 years ago committed by GitHub
commit 705597f649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

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

@ -29,9 +29,9 @@
#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/macro_helpers.h"
@ -44,6 +44,7 @@ struct cRGB {
namespace kaleidoscope {
namespace hardware {
namespace ez {
class ErgoDox {
public:
@ -186,9 +187,10 @@ class ErgoDox {
}
}
}
}
#include "kaleidoscope/hardware/key_indexes.h"
extern kaleidoscope::hardware::ErgoDox &ErgoDox;
extern kaleidoscope::hardware::ez::ErgoDox &ErgoDox;
#endif

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

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

@ -12,7 +12,7 @@
#include <inttypes.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 */

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

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