X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Scan%2FMatrixARM%2Fmatrix_scan.h;h=810e6d9ddee0146a1f8a580ecb21750003aa3fb1;hb=98f796d4df16c5aa14d0d07a5250c589dfb5f13a;hp=13839a192d88edd69efa29014ca8c122d88583e7;hpb=aeaaaaa468e95e732f12725f87f9a4fce70b5de0;p=kiibohd-controller.git diff --git a/Scan/MatrixARM/matrix_scan.h b/Scan/MatrixARM/matrix_scan.h index 13839a1..810e6d9 100644 --- a/Scan/MatrixARM/matrix_scan.h +++ b/Scan/MatrixARM/matrix_scan.h @@ -19,8 +19,7 @@ * THE SOFTWARE. */ -#ifndef __MATRIX_SCAN_H -#define __MATRIX_SCAN_H +#pragma once // ----- Includes ----- @@ -41,6 +40,12 @@ #error "Debounce threshold is too high... 32 bit max. Check .kll defines." #endif +#if ( MinDebounceTime_define > 0xFF ) +#error "MinDebounceTime is a maximum of 255 ms" +#elif ( MinDebounceTime_define < 0x00 ) +#error "MinDebounceTime is a minimum 0 ms" +#endif + // ----- Enums ----- @@ -127,11 +132,12 @@ typedef struct GPIO_Pin { // Debounce Element typedef struct KeyState { - KeyPosition prevState; - KeyPosition curState; DebounceCounter activeCount; DebounceCounter inactiveCount; -} KeyState; + KeyPosition prevState; + KeyPosition curState; + uint8_t prevDecisionTime; +} __attribute__((packed)) KeyState; @@ -140,6 +146,3 @@ typedef struct KeyState { void Matrix_setup(); void Matrix_scan( uint16_t scanNum ); - -#endif // __MATRIX_SCAN_H -