From 721fd86bc24c5d9752c89df4b97e8e8cb9dbad6c Mon Sep 17 00:00:00 2001 From: wolfv6 Date: Wed, 7 Sep 2016 21:27:51 -0600 Subject: [PATCH] change DH to move scanner instantiation from Row_DH_uC and Row_DH_IOE to sketch --- src/Row.h | 10 ++++++---- src/config_keybrd.h | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Row.h b/src/Row.h index a042aea..79faaa0 100644 --- a/src/Row.h +++ b/src/Row.h @@ -16,18 +16,20 @@ strobePin has one of two formats: class Row { private: + virtual void keyWasPressed(); + protected: + void send(const uint8_t readPinCount, const read_pins_t debouncedChanged); ScannerInterface& refScanner; const uint8_t strobePin; //pin connected to this row (details above) + private: Key *const *const ptrsKeys; //array of Key pointers + protected: const uint8_t readPinCount; //number of read pins Debouncer_Samples debouncer; - virtual void keyWasPressed(); - protected://todo is protected needed? read_pins_t debounced; //bitwise state of keys after debouncing, 1=pressed, 0=released - void send(const uint8_t readPinCount, const read_pins_t debouncedChanged); public: Row(ScannerInterface& refScanner, const uint8_t strobePin, Key* const ptrsKeys[], const uint8_t readPinCount); - void process(); + virtual void process(); }; #endif diff --git a/src/config_keybrd.h b/src/config_keybrd.h index 21f19ef..a87d01a 100644 --- a/src/config_keybrd.h +++ b/src/config_keybrd.h @@ -13,9 +13,9 @@ Using smaller types on a 32-bit uC (Teensy LC) would accomplish nothing. For Scanner_ShiftRegs74HC165, Scanner_ShiftRegs74HC165::readPinCount For Scanner_IOE, cover the last 1 bit in Scanner_IOE::strobePin */ -//typedef uint8_t read_pins_t; +typedef uint8_t read_pins_t; //typedef uint16_t read_pins_t; -typedef uint32_t read_pins_t; +//typedef uint32_t read_pins_t; /* SAMPLE_COUNT_MACRO is used in Debouncer_Samples.h SAMPLE_COUNT_MACRO = 4 is very reliable for a keyboard.