keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

Debouncer_Not.cpp 502B

123456789101112131415
  1. #include "Debouncer_Not.h"
  2. /* debounce() sets debounced and returns debouncedChanged. All variables are bitwise.
  3. For parameters, 1 means pressed, 0 means released.
  4. For return, 1 means debounced changed.
  5. */
  6. read_pins_t Debouncer_Not::debounce(const read_pins_t rawSignal, read_pins_t& debounced)
  7. {
  8. read_pins_t previousDebounced; //bitwise, 1 means pressed, 0 means released
  9. previousDebounced = debounced;
  10. debounced = rawSignal;
  11. return debounced xor previousDebounced;
  12. }