From 2887eeaa61be033e2246539a792e02f349b90c71 Mon Sep 17 00:00:00 2001 From: wolfv6 Date: Thu, 7 Jul 2016 15:31:34 -0600 Subject: [PATCH] remove RowScannerInterface, add KEY_COUNT, change COL_PIN_L_COUNT to KEY_COUNT --- doc/keybrd_library_developer_guide.md | 6 +----- src/RowScannerInterface.h | 16 ---------------- src/RowScanner_PinsArray.h | 3 +-- src/RowScanner_PinsBitwise.h | 3 +-- src/RowScanner_SPIShiftRegisters.h | 4 ++-- src/Row_IOE.h | 2 +- src/Row_uC.h | 6 +++--- 7 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 src/RowScannerInterface.h diff --git a/doc/keybrd_library_developer_guide.md b/doc/keybrd_library_developer_guide.md index a5b4cd1..7142f3e 100644 --- a/doc/keybrd_library_developer_guide.md +++ b/doc/keybrd_library_developer_guide.md @@ -19,7 +19,6 @@ The keybrd library is flexible for designing custom Rows this example illustrates the custom Row classes for a fictional keybrd_Ext extension library the keybrd_Ext library is for a split keyboard with a matrix on each hand -other custom Row classes would have a similar structure Row_Ext::keyWasPressed() overrides RowBase::keyWasPressed() Row_Ext::keyWasPressed() is used to unstick sticky keys @@ -38,8 +37,6 @@ Class inheritance diagram Row_Ext_uC Row_Ext_ShiftRegisters (inherit Row_Ext::keyWasPressed() ) - RowScannerInterface - / \ RowScanner_PinsArray RowScanner_SPIShiftRegisters ``` @@ -70,8 +67,7 @@ Keybrd library class inheritance diagram / | \ Row_uC Row_ShiftRegisters Row_IOE - _____ RowScannerInterface ______ - / | \ + RowScanner_PinsArray RowScanner_PinsBitwise RowScanner_SPIShiftRegisters diff --git a/src/RowScannerInterface.h b/src/RowScannerInterface.h deleted file mode 100644 index 3d37117..0000000 --- a/src/RowScannerInterface.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef ROWSCANNERINTERFACE_H -#define ROWSCANNERINTERFACE_H - -#include -#include -#include - -class RowScannerInterface -{ - public: - // virtual read_pins_t scan(read_pins_mask_t& rowEnd)=0; - // todo, remove RowScannerInterface because - // some RowScanners will return ColPort e.g. RowScanner_PinsBitwise -}; -#endif - diff --git a/src/RowScanner_PinsArray.h b/src/RowScanner_PinsArray.h index a54f539..ddb7e04 100644 --- a/src/RowScanner_PinsArray.h +++ b/src/RowScanner_PinsArray.h @@ -3,7 +3,6 @@ #include #include #include -#include #include #include @@ -11,7 +10,7 @@ The maximum keys per row is 31, because Arduino's largest type is 32 bits and rowEnd consumes the last bit. Constructor is in RowScanner_PinsArray.cpp */ -class RowScanner_PinsArray : public RowScannerInterface +class RowScanner_PinsArray { private: static const bool ACTIVE_HIGH; //logic level of strobe pin: 0=activeLow, 1=activeHigh diff --git a/src/RowScanner_PinsBitwise.h b/src/RowScanner_PinsBitwise.h index ec3fc84..23ae99f 100644 --- a/src/RowScanner_PinsBitwise.h +++ b/src/RowScanner_PinsBitwise.h @@ -2,14 +2,13 @@ #define ROWSCANNER_PINSBITWISE_H #include #include -#include #include #include /* RowScanner_PinsBitwise uses bit manipulation to read all pins of one port. The maximum keys per row is 8, because ports have a maximum of 8 pins each. */ -class RowScanner_PinsBitwise : public RowScannerInterface +class RowScanner_PinsBitwise { private: RowPort& refRowPort; //this row's IC port diff --git a/src/RowScanner_SPIShiftRegisters.h b/src/RowScanner_SPIShiftRegisters.h index fc031d3..b6e9139 100644 --- a/src/RowScanner_SPIShiftRegisters.h +++ b/src/RowScanner_SPIShiftRegisters.h @@ -2,8 +2,8 @@ #define ROWSCANNER_SPI_SHIFTREGISTERS_H #include #include +#include #include -#include #include #include @@ -28,7 +28,7 @@ The two parts of a split keyboard can be connected by one of: * Ethernet cable (has 8 wires, good for 3 rows) */ -class RowScanner_SPIShiftRegisters : public RowScannerInterface +class RowScanner_SPIShiftRegisters { private: static const uint8_t SHIFT_LOAD; //controller's pin number that is connected to shift register's SHIFT_LOAD pin diff --git a/src/Row_IOE.h b/src/Row_IOE.h index f607ff9..440a804 100644 --- a/src/Row_IOE.h +++ b/src/Row_IOE.h @@ -39,7 +39,7 @@ class Row_IOE : public RowBase Debouncer_4Samples debouncer; public: Row_IOE( RowPort& refRowPort, const uint8_t strobePin, - ColPort& refColPort, Key *const ptrsKeys[], const uint8_t KEY_COUNT) + ColPort& refColPort, Key *const ptrsKeys[], const uint8_t KEY_COUNT) //todo if KEY_COUNT is passed in, store it in private : RowBase(ptrsKeys), scanner(refRowPort, strobePin, refColPort) { } void process(); uint8_t getRowState(ColPort* ptrColPort, uint8_t& KEY_COUNT); diff --git a/src/Row_uC.h b/src/Row_uC.h index 3c2f625..2bc969b 100644 --- a/src/Row_uC.h +++ b/src/Row_uC.h @@ -32,9 +32,9 @@ class Row_uC : public RowBase RowScanner_PinsArray scanner; Debouncer_4Samples debouncer; public: - Row_uC(const uint8_t strobePin, const uint8_t readPins[], const uint8_t READ_PIN_COUNT, - Key *const ptrsKeys[]) - : RowBase(ptrsKeys), scanner(strobePin, readPins, READ_PIN_COUNT) { } + Row_uC(const uint8_t strobePin, const uint8_t readPins[], + Key *const ptrsKeys[], const uint8_t KEY_COUNT) + : RowBase(ptrsKeys), scanner(strobePin, readPins, KEY_COUNT) { } void process(); }; #endif