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_Samples.h 645B

12345678910111213141516171819202122
  1. #ifndef DEBOUNCER_SAMPLES_H
  2. #define DEBOUNCER_SAMPLES_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <config_keybrd.h>
  6. #include <DebouncerInterface.h>
  7. /* Debouncer_Samples
  8. Configuration: SAMPLE_COUNT is defined in config_keybrd.h
  9. */
  10. class Debouncer_Samples : public DebouncerInterface
  11. {
  12. private:
  13. read_pins_t samples[SAMPLE_COUNT]; //bits, one bit per key, most recent readings
  14. uint8_t samplesIndex; //samples[] current write index
  15. public:
  16. Debouncer_Samples(): samplesIndex(0) {}
  17. virtual read_pins_t debounce(const read_pins_t rawSignal, read_pins_t& debounced);
  18. };
  19. #endif