diff --git a/src/ReadPort.cpp b/src/ReadPort.cpp index f5b7c63..4109cc9 100644 --- a/src/ReadPort.cpp +++ b/src/ReadPort.cpp @@ -7,7 +7,5 @@ uint8_t ReadPort::getColPins() uint8_t ReadPort::getPortState() { -//todo Keyboard.print(" portState="); -//Keyboard.print(portState); return portState; } diff --git a/src/Row_ShiftRegisters.cpp b/src/Row_ShiftRegisters.cpp index 670237e..6fa9097 100644 --- a/src/Row_ShiftRegisters.cpp +++ b/src/Row_ShiftRegisters.cpp @@ -4,7 +4,6 @@ void Row_ShiftRegisters::process() { //these variables are all bitwise, one bit per key read_pins_t rowState; //1 means pressed, 0 means released - //uint8_t readPinCount; read_pins_t debouncedChanged; //1 means debounced changed rowState = scanner.scan(); diff --git a/src/Row_uC.cpp b/src/Row_uC.cpp index 6855044..bc194ca 100644 --- a/src/Row_uC.cpp +++ b/src/Row_uC.cpp @@ -7,7 +7,6 @@ void Row_uC::process() { //these variables are all bitwise, one bit per key read_pins_t rowState; //1 means pressed, 0 means released - //uint8_t readPinCount; read_pins_t debouncedChanged; //1 means debounced changed rowState = scanner.scan(); diff --git a/src/Row_uC.h b/src/Row_uC.h index f269621..b9e16b3 100644 --- a/src/Row_uC.h +++ b/src/Row_uC.h @@ -35,7 +35,8 @@ class Row_uC : public Row public: Row_uC(const uint8_t strobePin, const uint8_t READ_PINS[], const uint8_t READ_PIN_COUNT, Key *const ptrsKeys[]) - : Row(ptrsKeys), scanner(strobePin, READ_PINS, READ_PIN_COUNT), READ_PIN_COUNT(READ_PIN_COUNT) { } + : Row(ptrsKeys), scanner(strobePin, READ_PINS, READ_PIN_COUNT), + READ_PIN_COUNT(READ_PIN_COUNT) { } void process(); }; #endif diff --git a/src/Scanner_Port.h b/src/Scanner_Port.h index 12e2f68..8703cfc 100644 --- a/src/Scanner_Port.h +++ b/src/Scanner_Port.h @@ -11,15 +11,13 @@ The maximum keys per row is 8, because ports have a maximum of 8 pins each. class Scanner_Port { private: + static const bool STROBE_ON; //HIGH or LOW logic level of strobe on, active state StrobePort& refStrobePort; //this row's IC port const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row ReadPort& refReadPort; public: - Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin, - ReadPort& refReadPort) - : refStrobePort(refStrobePort), strobePin(strobePin), - refReadPort(refReadPort) {} - static const bool STROBE_ON; //logic level of strobe on, active state, HIGH or LOW + Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin, ReadPort& refReadPort) + : refStrobePort(refStrobePort), strobePin(strobePin), refReadPort(refReadPort) {} virtual ReadPort* const scan(); }; #endif diff --git a/src/Scanner_ShiftRegs74HC165.h b/src/Scanner_ShiftRegs74HC165.h index 44b57aa..21b443b 100644 --- a/src/Scanner_ShiftRegs74HC165.h +++ b/src/Scanner_ShiftRegs74HC165.h @@ -44,7 +44,6 @@ class Scanner_ShiftRegs74HC165 static const bool STROBE_OFF; //logic level of strobe off, complement of active state const uint8_t STROBE_PIN; //Arduino pin number connected to this row const uint8_t BYTE_COUNT; //number of bytes to read from shift registers - //uint8_t READ_PIN_COUNT; public: Scanner_ShiftRegs74HC165(const uint8_t STROBE_PIN, uint8_t READ_PIN_COUNT); virtual read_pins_t scan(); diff --git a/src/config_keybrd.h b/src/config_keybrd.h index 83e5d3f..9aef07d 100644 --- a/src/config_keybrd.h +++ b/src/config_keybrd.h @@ -13,9 +13,9 @@ Using smaller types on a 32-bit uC (Teensy LC) would accomplish nothing. For Scanner_ShiftRegs74HC165, Scanner_ShiftRegs74HC165::READ_PIN_COUNT For Scanner_Port, cover the last 1 bit in Scanner_Port::strobePin */ -//typedef uint8_t read_pins_t; +typedef uint8_t read_pins_t; //typedef uint16_t read_pins_t; -typedef uint32_t read_pins_t; +//typedef uint32_t read_pins_t; /* SAMPLE_COUNT = 4 is very reliable for a keyboard. Split keyboards with a long connecting wire or in environment with