* THE SOFTWARE.
*/
-#ifndef __MATRIX_SCAN_H
-#define __MATRIX_SCAN_H
+#pragma once
// ----- Includes -----
#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 -----
// Debounce Element
typedef struct KeyState {
- KeyPosition prevState;
- KeyPosition curState;
DebounceCounter activeCount;
DebounceCounter inactiveCount;
-} KeyState;
+ KeyPosition prevState;
+ KeyPosition curState;
+ uint8_t prevDecisionTime;
+} __attribute__((packed)) KeyState;
void Matrix_setup();
void Matrix_scan( uint16_t scanNum );
-
-#endif // __MATRIX_SCAN_H
-