add keyboard source code

This commit is contained in:
cuu
2023-06-14 13:46:28 +12:00
parent 5b69e9c831
commit 17269a8c72
24 changed files with 1850 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#include "debouncer.h"
Debouncer::Debouncer()
: timeout(0)
{
}
void Debouncer::updateTime(millis_t delta) {
if (timeout > delta) {
timeout -= delta;
} else {
timeout = 0;
}
}
bool Debouncer::sample(bool value) {
if (value || timeout == 0) {
timeout = DEBOUNCE_MS;
return true;
}
return false;
}