comparison Scan/MatrixARM/matrix_scan.h @ 415:293154e4aafe

Added support for ghosting matrices and code for elimination. To use define GHOST in matrix.h, see example in Scan/CK3
author CryHam <cryham@gmail.com>
date Fri, 19 Feb 2016 18:10:25 +0100
parents e464aaa4730f
children 060aa589b307
comparison
equal deleted inserted replaced
414:06b8d295518e 415:293154e4aafe
137 KeyPosition prevState; 137 KeyPosition prevState;
138 KeyPosition curState; 138 KeyPosition curState;
139 uint8_t prevDecisionTime; 139 uint8_t prevDecisionTime;
140 } __attribute__((packed)) KeyState; 140 } __attribute__((packed)) KeyState;
141 141
142 // Ghost Element, after ghost detection/cancelation
143 typedef struct KeyGhost {
144 KeyPosition prev;
145 KeyPosition cur;
146 KeyPosition saved; // state before ghosting
147 } __attribute__((packed)) KeyGhost;
148
149 // utility
150 inline uint8_t keyOn(/*KeyPosition*/uint8_t st)
151 { return (st == KeyState_Press || st == KeyState_Hold) ? 1 : 0; }
142 152
143 153
144 // ----- Functions ----- 154 // ----- Functions -----
145 155
146 void Matrix_setup(); 156 void Matrix_setup();