Browse Source

changed scanner_Port::scan() to return refReadPort.getPortState()

tags/v0.5.0
wolfv6 7 years ago
parent
commit
37186b7586
3 changed files with 12 additions and 7 deletions
  1. 5
    0
      src/ReadPort_PCA9655E.cpp
  2. 6
    6
      src/Scanner_Port.cpp
  3. 1
    1
      src/Scanner_Port.h

+ 5
- 0
src/ReadPort_PCA9655E.cpp View File

@@ -27,4 +27,9 @@ void ReadPort_PCA9655E::read()
Wire.requestFrom(port.ADDR, 1u); //request one byte from input port
portState = Wire.read();
/*if (portState)//todo
{
Keyboard.print(" portState=");
Keyboard.print(portState);
}*/
}

+ 6
- 6
src/Scanner_Port.cpp View File

@@ -2,14 +2,14 @@
/*
Strobes the row and reads the columns.
*/
ReadPort* const Scanner_Port::scan()
uint8_t Scanner_Port::scan()
{
//strobe row on
if (STROBE_ON == LOW)
if (STROBE_ON == LOW) //if activeLow
{
refStrobePort.setActivePinLow(strobePin);
}
else //activeLow
else //if activeHigh
{
refStrobePort.setActivePinHigh(strobePin);
}
@@ -19,14 +19,14 @@ ReadPort* const Scanner_Port::scan()
refReadPort.read();

//strobe row off
if (STROBE_ON == LOW)
if (STROBE_ON == LOW) //if activeLow
{
refStrobePort.setActivePinHigh(strobePin);
}
else //activeLow
else //if activeHigh
{
refStrobePort.setActivePinLow(strobePin);
}
return &refReadPort;
return refReadPort.getPortState();
}

+ 1
- 1
src/Scanner_Port.h View File

@@ -18,6 +18,6 @@ class Scanner_Port
public:
Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin, ReadPort& refReadPort)
: refStrobePort(refStrobePort), strobePin(strobePin), refReadPort(refReadPort) {}
virtual ReadPort* const scan();
uint8_t scan();
};
#endif