Rapid -/+ taps and hold-to-repeat on the setpoint pill (0.2.25)

App 0.2.25 / firmware 0.2.21. The 600 ms touch-guard lockout dropped a second
tap on the same -/+ key; stepper keys now use a 150 ms bounce guard, repeat
while held (3 per second), and still send one call after 700 ms of rest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-13 15:20:38 +02:00
parent 5a05f52dbc
commit ea7bf3387b
11 changed files with 46 additions and 10 deletions
+7
View File
@@ -14,6 +14,13 @@ int main() {
assert(quantize_temperature(-1, 160, 300, 5) == 160);
assert(quantize_temperature(999, 160, 299, 5) == 299);
assert(quantize_temperature(201, 160, 300, 0) == 201);
// -/+ keys: quick successive taps on the same key all count; bounce within 150 ms does not.
cyd::TouchGuard r;
r.begin(1000); assert(r.accept_repeat(1060, 7)); assert(!r.accept_repeat(1070, 7)); // one contact, one step
r.begin(1200); assert(r.accept_repeat(1260, 7)); // 200 ms later: accepted
r.begin(1300); assert(!r.accept_repeat(1340, 7)); // 80 ms after the last: bounce
r.begin(1300); r.update(40, 0); assert(!r.accept_repeat(1500, 7)); // a swipe is never a step
r.begin(1600); assert(r.accept_repeat(1660, 8)); // the other key right away
cyd::TouchGuard g;
g.begin(100);
assert(!g.accept(120, 1)); // resistive noise pulse