Added support for ghosting matrices and code for elimination.

To use define GHOST in matrix.h, see example in Scan/CK3
This commit is contained in:
CryHam 2016-02-19 18:10:25 +01:00 committed by Jacob Alexander
parent bba3ec8609
commit 953d5a407b
9 changed files with 712 additions and 1 deletions

View file

@ -139,6 +139,16 @@ typedef struct KeyState {
uint8_t prevDecisionTime;
} __attribute__((packed)) KeyState;
// Ghost Element, after ghost detection/cancelation
typedef struct KeyGhost {
KeyPosition prev;
KeyPosition cur;
KeyPosition saved; // state before ghosting
} __attribute__((packed)) KeyGhost;
// utility
inline uint8_t keyOn(/*KeyPosition*/uint8_t st)
{ return (st == KeyState_Press || st == KeyState_Hold) ? 1 : 0; }
// ----- Functions -----