Break apart a method for easier reuse

pull/24/head
Jesse Vincent 8 years ago
parent 8afa7d2dd2
commit 6164386466

@ -83,7 +83,10 @@ void debug_key_event(keydata_t state, keydata_t previousState, uint8_t keynum, u
Serial.println();
}
}
void Model01::scan_matrix() {
void Model01::read_matrix() {
//scan the Keyboard matrix looking for connections
previousLeftHandState = leftHandState;
previousRightHandState = rightHandState;
@ -94,7 +97,11 @@ void Model01::scan_matrix() {
if (rightHand.readKeys()) {
rightHandState = rightHand.getKeyData();
}
}
void Model01::act_on_matrix_scan() {
for (byte row = 0; row < 4; row++) {
for (byte col = 0; col < 8; col++) {
@ -111,5 +118,10 @@ void Model01::scan_matrix() {
);
}
}
//scan the Keyboard matrix looking for connections
}
void Model01::scan_matrix() {
read_matrix();
act_on_matrix_scan();
}

@ -24,18 +24,20 @@ class Model01 {
cRGB get_key_color(byte row, byte col);
void scan_matrix(void);
void read_matrix(void);
void act_on_matrix_scan(void);
void setup();
void enable_high_power_leds(void);
void enable_scanner_power(void);
private:
static KeyboardioScanner leftHand;
static KeyboardioScanner rightHand;
keydata_t leftHandState;
keydata_t rightHandState;
keydata_t previousLeftHandState;
keydata_t previousRightHandState;
private:
static KeyboardioScanner leftHand;
static KeyboardioScanner rightHand;
static constexpr uint8_t key_led_map[4][16] = {
{3,4,11,12,19,20,26,27, 36,37,43,44,51,52,59,60},
{2,5,10,13,18,21,31,28, 35,32,42,45,50,53,58,61},

Loading…
Cancel
Save