Archived
1
0

move PortRead::readPins from PortRead to PortRead_PCA9655E

This commit is contained in:
wolfv6 2016-08-31 20:53:34 -06:00
parent caa29dec63
commit 4c082faa68
4 changed files with 3 additions and 8 deletions

View File

@ -12,10 +12,7 @@ Details are in config_key.h
*/ */
class PortRead class PortRead
{ {
protected:
const uint8_t readPins; //bitwise pin configuration, 1 means read pin
public: public:
PortRead(const uint8_t readPins): readPins(readPins) {}
virtual uint8_t read()=0; virtual uint8_t read()=0;
}; };
#endif #endif

View File

@ -31,12 +31,9 @@ class PortRead_MCP23S17 : public PortRead
PortIOE& port; PortIOE& port;
public: 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 //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(); virtual uint8_t read();
}; };
#endif #endif

View File

@ -4,7 +4,7 @@
configures column port's configuration, input, and pins. configures column port's configuration, input, and pins.
*/ */
PortRead_PCA9655E::PortRead_PCA9655E (PortIOE& port, const uint8_t readPins) 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) configurationByteCommand(port.num + 6), inputByteCommand(port.num)
{} {}

View File

@ -29,6 +29,7 @@ class PortRead_PCA9655E : public PortRead
{ {
private: private:
PortIOE& port; PortIOE& port;
const uint8_t readPins; //bitwise pin configuration, 1 means read pin
const uint8_t configurationByteCommand; const uint8_t configurationByteCommand;
const uint8_t inputByteCommand; const uint8_t inputByteCommand;
public: public: