Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/src/Debouncer_Not.cpp
2016-07-02 15:10:02 -06:00

16 lines
502 B
C++

#include "Debouncer_Not.h"
/* debounce() sets debounced and returns debouncedChanged. All variables are bitwise.
For parameters, 1 means pressed, 0 means released.
For return, 1 means debounced changed.
*/
read_pins_t Debouncer_Not::debounce(const read_pins_t rawSignal, read_pins_t& debounced)
{
read_pins_t previousDebounced; //bitwise, 1 means pressed, 0 means released
previousDebounced = debounced;
debounced = rawSignal;
return debounced xor previousDebounced;
}