3 #ifdef HAS_INPUT_SUPPORT
5 void input_setup(void){
10 for(int i
=0; i
<INPUT_COUNT
; i
++){
11 //A #define for the debounce time would be great
12 if(debounce_timeouts
[i
] == 0){
13 if(switch_states
[i
]&1 ^ switch_states
[i
]>>1){
16 uart_puthex(switch_states
[i
]&1);
18 debounce_timeouts
[i
] = 0xF0;
19 switch_states
[i
] = (switch_states
[i
]<<1)&3;
21 switch_states
[i
] &= 0xFE;
23 debounce_timeouts
[i
]--;
28 uint8_t debounce_timeouts
[INPUT_COUNT
];
29 uint8_t switch_states
[INPUT_COUNT
];
31 #else//HAS_INPUT_SUPPORT
36 #endif//HAS_INPUT_SUPPORT