Browse Source

move PortRead::readPins from PortRead to PortRead_PCA9655E

tags/v0.6.0
wolfv6 7 years ago
parent
commit
4c082faa68
4 changed files with 3 additions and 8 deletions
  1. 0
    3
      src/PortRead.h
  2. 1
    4
      src/PortRead_MCP23S17.h
  3. 1
    1
      src/PortRead_PCA9655E.cpp
  4. 1
    0
      src/PortRead_PCA9655E.h

+ 0
- 3
src/PortRead.h View File

*/ */
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

+ 1
- 4
src/PortRead_MCP23S17.h View File

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

+ 1
- 1
src/PortRead_PCA9655E.cpp View File

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)
{} {}

+ 1
- 0
src/PortRead_PCA9655E.h View File

{ {
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: