X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=inline;f=Scan%2FMatrixARM%2Fmatrix_scan.h;fp=Scan%2FMatrixARM%2Fmatrix_scan.h;h=8b9cee79ee19684c844e6877641cdb405f5227bc;hb=4f372c1909ea0899b970b9b12541564e17de8e05;hp=810e6d9ddee0146a1f8a580ecb21750003aa3fb1;hpb=1fd19c48eac0d7fd8834aa91783385c2844dca9a;p=kiibohd-controller.git diff --git a/Scan/MatrixARM/matrix_scan.h b/Scan/MatrixARM/matrix_scan.h index 810e6d9..8b9cee7 100644 --- a/Scan/MatrixARM/matrix_scan.h +++ b/Scan/MatrixARM/matrix_scan.h @@ -139,6 +139,18 @@ 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 -----