]> git.donarmstrong.com Git - kiibohd-controller.git/blobdiff - Scan/MatrixARM/matrix_scan.h
Added support for ghosting matrices and code for elimination.
[kiibohd-controller.git] / Scan / MatrixARM / matrix_scan.h
index 810e6d9ddee0146a1f8a580ecb21750003aa3fb1..ce09bf18d1a58f4b30ce74e5ad9aab7202dc999c 100644 (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 -----