#ifndef DRILL_BUTTON_H
#define DRILL_BUTTON_H
#include "drill_click.h"
typedef struct {
 dc_decoder clicks;
 uint32_t last_us, elapsed_us, candidate_us, now_ms;
 bool initialized, candidate_pressed, stable_pressed, released_armed;
} db_state;
/* active-low button normalized to pressed. Sample gap >20ms cancels gestures.
   20ms debounce and 450ms inter-click window are candidate values. */
void db_init(db_state *s,uint32_t now_us,bool pressed);
dc_command db_sample(db_state *s,uint32_t now_us,bool pressed);
#endif
