#ifndef CMSIS_DRIVER_BARE_DEBOUNCE_H #define CMSIS_DRIVER_BARE_DEBOUNCE_H #include #include typedef struct sample_state { bool candidate; uint32_t count; uint32_t count_reset; } sample_state; void debounce_init(sample_state *ss, bool initial, uint32_t threshold); bool *debounce(sample_state *ss, bool val); #endif