diff 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
line wrap: on
line diff
--- a/Scan/MatrixARM/matrix_scan.h	Thu Feb 11 22:56:25 2016 -0800
+++ b/Scan/MatrixARM/matrix_scan.h	Fri Feb 19 18:10:25 2016 +0100
@@ -139,6 +139,16 @@
 	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 -----