From f76ec3002da3ecc8a88a9c5775577d016238e3f6 Mon Sep 17 00:00:00 2001 From: wolfv6 Date: Wed, 13 Jul 2016 07:31:31 -0600 Subject: [PATCH] remove ReadPort::getColPins() and StrobePort::setActivePinHigh() setActivePinLow() --- src/ReadPort.cpp | 7 ------- src/ReadPort.h | 1 - src/Scanner_Port.cpp | 16 ---------------- src/StrobePort.h | 2 -- src/StrobePort_PCA9655E.cpp | 28 ++++------------------------ src/StrobePort_PCA9655E.h | 2 -- 6 files changed, 4 insertions(+), 52 deletions(-) delete mode 100644 src/ReadPort.cpp diff --git a/src/ReadPort.cpp b/src/ReadPort.cpp deleted file mode 100644 index 68141c8..0000000 --- a/src/ReadPort.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "ReadPort.h" - -uint8_t ReadPort::getColPins() -{ - return readPins; -} - diff --git a/src/ReadPort.h b/src/ReadPort.h index f607e47..8acd86a 100644 --- a/src/ReadPort.h +++ b/src/ReadPort.h @@ -17,6 +17,5 @@ class ReadPort //read port and store it's pins values in portState virtual uint8_t read()=0; - uint8_t getColPins(); }; #endif diff --git a/src/Scanner_Port.cpp b/src/Scanner_Port.cpp index d0503ee..7facb8c 100644 --- a/src/Scanner_Port.cpp +++ b/src/Scanner_Port.cpp @@ -6,14 +6,6 @@ uint8_t Scanner_Port::scan() { uint8_t readState; - /*if (STROBE_ON == LOW) //if activeLow - { - refStrobePort.setActivePinLow(strobePin); - } - else //if activeHigh - { - refStrobePort.setActivePinHigh(strobePin); - }*/ //strobe row on refStrobePort.write(STROBE_PIN, STROBE_ON); delayMicroseconds(3); //time to stablize voltage @@ -23,14 +15,6 @@ uint8_t Scanner_Port::scan() //strobe row off refStrobePort.write(STROBE_PIN, STROBE_OFF); - /*if (STROBE_ON == LOW) //if activeLow - { - refStrobePort.setActivePinHigh(strobePin); - } - else //if activeHigh - { - refStrobePort.setActivePinLow(strobePin); - }*/ //return refReadPort.getPortState(); return readState; diff --git a/src/StrobePort.h b/src/StrobePort.h index 8bd5212..b8b827b 100644 --- a/src/StrobePort.h +++ b/src/StrobePort.h @@ -10,8 +10,6 @@ Port classes are the keybrd library's interface to microcontoller ports or I/O e class StrobePort { public: - virtual void setActivePinHigh(const uint8_t activePin)=0; - virtual void setActivePinLow(const uint8_t activePin)=0; virtual void write(const uint8_t pin, const bool level)=0; }; #endif diff --git a/src/StrobePort_PCA9655E.cpp b/src/StrobePort_PCA9655E.cpp index be31dd8..bdbec28 100644 --- a/src/StrobePort_PCA9655E.cpp +++ b/src/StrobePort_PCA9655E.cpp @@ -15,38 +15,18 @@ void StrobePort_PCA9655E::begin() } /* -sets activePin pin output to low, does not reset the other pins because they might be used by LEDs. -activePin is port mask, where active pin is 1. +pin is bitwise, where pin being strobed is 1. +level is HIGH or LOW. */ -void StrobePort_PCA9655E::setActivePinLow(const uint8_t activePin) -{ - Wire.beginTransmission(port.ADDR); - Wire.write(outputByteCommand); - Wire.write(port.outputVal &= ~activePin); - Wire.endTransmission(); -} - -/* -sets activePin pin output to high. -activePin is port mask, where active pin is 1. -*/ -void StrobePort_PCA9655E::setActivePinHigh(const uint8_t activePin) -{ - Wire.beginTransmission(port.ADDR); - Wire.write(outputByteCommand); - Wire.write(port.outputVal |= activePin); - Wire.endTransmission(); - //todo delayMicroseconds(1500); still 4*bb w/o debouncer prints IOE rows sporadically -} void StrobePort_PCA9655E::write(const uint8_t pin, const bool level) { if (level == LOW) { - port.outputVal &= ~pin; + port.outputVal &= ~pin; //set pin output to low, do not reset the other pins because LEDs } else { - port.outputVal |= pin; + port.outputVal |= pin; //set pin output to high } Wire.beginTransmission(port.ADDR); diff --git a/src/StrobePort_PCA9655E.h b/src/StrobePort_PCA9655E.h index d000929..594bc04 100644 --- a/src/StrobePort_PCA9655E.h +++ b/src/StrobePort_PCA9655E.h @@ -44,8 +44,6 @@ class StrobePort_PCA9655E : public StrobePort StrobePort_PCA9655E(IOEPort& port); void begin(); - virtual void setActivePinLow(const uint8_t activePin); //activePin is a port mask todo delete - virtual void setActivePinHigh(const uint8_t activePin); //todo delete also in StrobePort.h virtual void write(const uint8_t pin, const bool level); }; #endif