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 518B

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