Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
ee537c461This file is pinned to the selected release. Download the original to open it in your design tool.
// ButtonDebouncer.cpp
// Created by Will Yager on 7/3/13.
// Copyright (c) 2013 Will Yager. All rights reserved.
// Responsible for debouncing hardware buttons
#include "hardware/ButtonDebouncer.h"
//Debounce raw hardware samples
ButtonsState ButtonDebouncer::update(const ButtonsState& raw_state){
ButtonsState result;
for (int i = 0; i < 64; ++i){
bool debounced_state = this->debouncer.update(i, raw_state.states[i]);
result.states[i] = debounced_state;
}
return result;
}