Added KeyAddr and numKeys() to all hardware classes

Signed-off-by: Florian Fleissner <florian.fleissner@inpartik.de>
pull/640/head
Florian Fleissner 6 years ago committed by Jesse Vincent
parent 77bdd0c0a1
commit 2cd9d22ee3

@ -21,6 +21,8 @@
#pragma once #pragma once
#include "kaleidoscope/MatrixAddr.h"
#ifndef CRGB #ifndef CRGB
#error cRGB and CRGB *must* be defined before including this header! #error cRGB and CRGB *must* be defined before including this header!
#endif #endif

@ -56,6 +56,11 @@ class ErgoDox : public kaleidoscope::Hardware {
static constexpr byte matrix_rows = 14; static constexpr byte matrix_rows = 14;
static constexpr int8_t led_count = 0; static constexpr int8_t led_count = 0;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
void scanMatrix(void); void scanMatrix(void);
void readMatrix(void); void readMatrix(void);
void actOnMatrixScan(void); void actOnMatrixScan(void);

@ -45,6 +45,11 @@ class KBD4x: public kaleidoscope::hardware::ATMegaKeyboard {
static constexpr int8_t led_count = 0; static constexpr int8_t led_count = 0;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
void resetDevice(); void resetDevice();
}; };

@ -43,6 +43,11 @@ class Model01 : public kaleidoscope::Hardware {
static constexpr byte matrix_columns = 16; static constexpr byte matrix_columns = 16;
static constexpr int8_t led_count = 64; static constexpr int8_t led_count = 64;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
void syncLeds(void); void syncLeds(void);
void setCrgbAt(byte row, byte col, cRGB color); void setCrgbAt(byte row, byte col, cRGB color);
void setCrgbAt(int8_t i, cRGB crgb); void setCrgbAt(int8_t i, cRGB crgb);

@ -41,6 +41,11 @@ class Planck: public kaleidoscope::hardware::ATMegaKeyboard {
); );
static constexpr int8_t led_count = 0; static constexpr int8_t led_count = 0;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
}; };
#define PER_KEY_DATA(dflt, \ #define PER_KEY_DATA(dflt, \

@ -50,6 +50,11 @@ class Splitography: public kaleidoscope::hardware::ATMegaKeyboard {
); );
static constexpr int8_t led_count = 0; static constexpr int8_t led_count = 0;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
}; };
#define PER_KEY_DATA(dflt, \ #define PER_KEY_DATA(dflt, \

@ -65,6 +65,11 @@ class Atreus: public kaleidoscope::hardware::ATMegaKeyboard {
static constexpr int8_t led_count = 0; static constexpr int8_t led_count = 0;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
void resetDevice(); void resetDevice();
protected: protected:

@ -43,6 +43,11 @@ class Atreus2: public kaleidoscope::hardware::ATMegaKeyboard {
) )
static constexpr int8_t led_count = 0; static constexpr int8_t led_count = 0;
typedef MatrixAddr<matrix_rows, matrix_columns> KeyAddr;
static constexpr int8_t numKeys() {
return matrix_columns * matrix_rows;
}
void resetDevice(); void resetDevice();
protected: protected:

Loading…
Cancel
Save