|
|
@ -158,15 +158,12 @@ void Model01::readMatrix() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Model01::actOnHalfRow(byte row, byte colState, byte colPrevState, byte startPos) {
|
|
|
|
void Model01::actOnHalfRow(byte row, byte colState, byte colPrevState, byte startPos) {
|
|
|
|
if ((colState == colPrevState) && (colState == 0)) {
|
|
|
|
if ((colState != colPrevState) || (colState != 0)) {
|
|
|
|
for (byte col = 0; col < 8; col++) {
|
|
|
|
|
|
|
|
handleKeyswitchEvent(Key_NoKey, row, startPos - col, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
for (byte col = 0; col < 8; col++) {
|
|
|
|
for (byte col = 0; col < 8; col++) {
|
|
|
|
// Build up the key state for row, col
|
|
|
|
// Build up the key state for row, col
|
|
|
|
uint8_t keyState = ((bitRead(colPrevState, 0) << 0) |
|
|
|
|
uint8_t keyState = ((bitRead(colPrevState, 0) << 0) |
|
|
|
|
(bitRead(colState, 0) << 1));
|
|
|
|
(bitRead(colState, 0) << 1));
|
|
|
|
|
|
|
|
if (keyState)
|
|
|
|
handleKeyswitchEvent(Key_NoKey, row, startPos - col, keyState);
|
|
|
|
handleKeyswitchEvent(Key_NoKey, row, startPos - col, keyState);
|
|
|
|
|
|
|
|
|
|
|
|
// Throw away the data we've just used, so we can read the next column
|
|
|
|
// Throw away the data we've just used, so we can read the next column
|
|
|
|