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 input_callback(i
, switch_states
[i
]&1);
19 debounce_timeouts
[i
] = 0xF0;
20 switch_states
[i
] = (switch_states
[i
]<<1)&3;
22 switch_states
[i
] &= 0xFE;
24 debounce_timeouts
[i
]--;
29 uint8_t debounce_timeouts
[INPUT_COUNT
];
30 uint8_t switch_states
[INPUT_COUNT
];
32 #else//HAS_INPUT_SUPPORT
37 #endif//HAS_INPUT_SUPPORT