fix buttons working, add basic brightness control

This commit is contained in:
true
2026-05-08 22:12:06 -07:00
parent fe169b64f6
commit b2de3abe08
5 changed files with 55 additions and 4 deletions

View File

@@ -62,18 +62,18 @@ void btn_process()
btn[i].hold++;
if (btn[i].hold == DEBOUNCE) {
btn_state[1] |= (1 << (i + 3));
btn_state[1] |= (1 << i);
}
}
// is held?
if (btn[i].hold == HOLD_COUNTS) {
btn_state[2] |= (1 << (i + 3));
btn_state[2] |= (1 << i);
}
// is repeated?
if (btn[i].repeat && (btn[i].hold == (HOLD_COUNTS + btn[i].repeat))) {
btn_state[2] |= (1 << (i + 3));
btn_state[2] |= (1 << i);
btn[i].hold = HOLD_COUNTS;
}
@@ -81,7 +81,7 @@ void btn_process()
if (!x) {
if (btn[i].hold) {
btn[i].hold = 0;
btn_state[3] |= (1 << (i + 3));
btn_state[3] |= (1 << i);
}
}
}