From 4c082faa68030db98a270c4acd13c85c7da1628d Mon Sep 17 00:00:00 2001 From: wolfv6 Date: Wed, 31 Aug 2016 20:53:34 -0600 Subject: [PATCH] move PortRead::readPins from PortRead to PortRead_PCA9655E --- src/PortRead.h | 3 --- src/PortRead_MCP23S17.h | 5 +---- src/PortRead_PCA9655E.cpp | 2 +- src/PortRead_PCA9655E.h | 1 + 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/PortRead.h b/src/PortRead.h index 9f3da80..1ee233c 100644 --- a/src/PortRead.h +++ b/src/PortRead.h @@ -12,10 +12,7 @@ Details are in config_key.h */ class PortRead { - protected: - const uint8_t readPins; //bitwise pin configuration, 1 means read pin public: - PortRead(const uint8_t readPins): readPins(readPins) {} virtual uint8_t read()=0; }; #endif diff --git a/src/PortRead_MCP23S17.h b/src/PortRead_MCP23S17.h index 97ab958..830615d 100644 --- a/src/PortRead_MCP23S17.h +++ b/src/PortRead_MCP23S17.h @@ -31,12 +31,9 @@ class PortRead_MCP23S17 : public PortRead PortIOE& port; public: /* -todo not all PortRead_ classes need a readPins - move PortRead::readPins from PortRead to PortRead_PCA9655E - remove PortRead(0) initialization from this constructor */ //The constructor initialization list is in .cpp - PortRead_MCP23S17(PortIOE& port) : PortRead(0), port(port) {} + PortRead_MCP23S17(PortIOE& port) : port(port) {} virtual uint8_t read(); }; #endif diff --git a/src/PortRead_PCA9655E.cpp b/src/PortRead_PCA9655E.cpp index 997b84d..8c11529 100644 --- a/src/PortRead_PCA9655E.cpp +++ b/src/PortRead_PCA9655E.cpp @@ -4,7 +4,7 @@ configures column port's configuration, input, and pins. */ PortRead_PCA9655E::PortRead_PCA9655E (PortIOE& port, const uint8_t readPins) - : PortRead(readPins), port(port), + : port(port), readPins(readPins), configurationByteCommand(port.num + 6), inputByteCommand(port.num) {} diff --git a/src/PortRead_PCA9655E.h b/src/PortRead_PCA9655E.h index 3a31f75..38a25ca 100644 --- a/src/PortRead_PCA9655E.h +++ b/src/PortRead_PCA9655E.h @@ -29,6 +29,7 @@ class PortRead_PCA9655E : public PortRead { private: PortIOE& port; + const uint8_t readPins; //bitwise pin configuration, 1 means read pin const uint8_t configurationByteCommand; const uint8_t inputByteCommand; public: