|
|
@ -47,16 +47,16 @@
|
|
|
|
constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_row_pins[matrix_rows]; \
|
|
|
|
constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_row_pins[matrix_rows]; \
|
|
|
|
constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_col_pins[matrix_columns]; \
|
|
|
|
constexpr uint8_t kaleidoscope::Device::KeyScannerProps::matrix_col_pins[matrix_columns]; \
|
|
|
|
template<> \
|
|
|
|
template<> \
|
|
|
|
volatile uint16_t kaleidoscope::Device::KeyScanner::previousKeyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
|
|
|
|
uint16_t kaleidoscope::Device::KeyScanner::previousKeyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
|
|
|
|
template<> \
|
|
|
|
template<> \
|
|
|
|
volatile uint16_t kaleidoscope::Device::KeyScanner::keyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
|
|
|
|
uint16_t kaleidoscope::Device::KeyScanner::keyState_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
|
|
|
|
template<> \
|
|
|
|
template<> \
|
|
|
|
uint16_t kaleidoscope::Device::KeyScanner::masks_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
|
|
|
|
uint16_t kaleidoscope::Device::KeyScanner::masks_[kaleidoscope::Device::KeyScannerProps::matrix_rows] = {}; \
|
|
|
|
template<> \
|
|
|
|
template<> \
|
|
|
|
uint8_t kaleidoscope::Device::KeyScanner::debounce_matrix_[kaleidoscope::Device::KeyScannerProps::matrix_rows][kaleidoscope::Device::KeyScannerProps::matrix_columns] = {}; \
|
|
|
|
uint8_t kaleidoscope::Device::KeyScanner::debounce_matrix_[kaleidoscope::Device::KeyScannerProps::matrix_rows][kaleidoscope::Device::KeyScannerProps::matrix_columns] = {}; \
|
|
|
|
\
|
|
|
|
\
|
|
|
|
ISR(TIMER1_OVF_vect) { \
|
|
|
|
ISR(TIMER1_OVF_vect) { \
|
|
|
|
Runtime.device().readMatrix(); \
|
|
|
|
Runtime.device().keyScanner().do_scan_ = true; \
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
namespace kaleidoscope {
|
|
|
|
namespace kaleidoscope {
|
|
|
@ -130,6 +130,10 @@ class ATmega: public kaleidoscope::driver::keyscanner::Base<_KeyScannerProps> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void scanMatrix() {
|
|
|
|
void scanMatrix() {
|
|
|
|
|
|
|
|
if (do_scan_) {
|
|
|
|
|
|
|
|
do_scan_ = false;
|
|
|
|
|
|
|
|
readMatrix();
|
|
|
|
|
|
|
|
}
|
|
|
|
actOnMatrixScan();
|
|
|
|
actOnMatrixScan();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -192,10 +196,12 @@ class ATmega: public kaleidoscope::driver::keyscanner::Base<_KeyScannerProps> {
|
|
|
|
key_addr.col());
|
|
|
|
key_addr.col());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool do_scan_;
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
typedef _KeyScannerProps KeyScannerProps_;
|
|
|
|
typedef _KeyScannerProps KeyScannerProps_;
|
|
|
|
static volatile uint16_t previousKeyState_[_KeyScannerProps::matrix_rows];
|
|
|
|
static uint16_t previousKeyState_[_KeyScannerProps::matrix_rows];
|
|
|
|
static volatile uint16_t keyState_[_KeyScannerProps::matrix_rows];
|
|
|
|
static uint16_t keyState_[_KeyScannerProps::matrix_rows];
|
|
|
|
static uint16_t masks_[_KeyScannerProps::matrix_rows];
|
|
|
|
static uint16_t masks_[_KeyScannerProps::matrix_rows];
|
|
|
|
static uint8_t debounce_matrix_[_KeyScannerProps::matrix_rows][_KeyScannerProps::matrix_columns];
|
|
|
|
static uint8_t debounce_matrix_[_KeyScannerProps::matrix_rows][_KeyScannerProps::matrix_columns];
|
|
|
|
|
|
|
|
|
|
|
|