Archived
1
0

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

This commit is contained in:
wolfv6 2016-07-13 05:37:26 -06:00
parent cd22ac0fe7
commit 37186b7586
3 changed files with 12 additions and 7 deletions

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);
}*/
}

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();
}

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