diff --git a/src/RowBase.cpp b/src/RowBase.cpp index 1d384dc..7b03575 100644 --- a/src/RowBase.cpp +++ b/src/RowBase.cpp @@ -4,7 +4,7 @@ pressRelease() calls key's press() or release() function if it was pressed or re Both parameters are bitwise. rowEnd bit marks positioned immediatly after last key of row. */ -void RowBase::pressRelease(const read_pins_mask_t rowEnd, const read_pins_t debouncedChanged) +void RowBase::pressRelease(const uint8_t KEY_COUNT, const read_pins_t debouncedChanged) { read_pins_t isFallingEdge; //bitwise, 1 means falling edge read_pins_t isRisingEdge; //bitwise, 1 means rising edge @@ -17,7 +17,7 @@ void RowBase::pressRelease(const read_pins_mask_t rowEnd, const read_pins_t debo //bit=1 if last debounced changed from 0 to 1, else bit=0 isRisingEdge = debouncedChanged & debounced; - for (rowMask=1, col=0; rowMaskgetColPins(); @@ -49,6 +51,7 @@ uint8_t Row_IOE::getRowState(ColPort* ptrColPort, read_pins_mask_t& rowEnd) } rowEnd <<= 1; //shift rowEnd to next key + KEY_COUNT++; } } diff --git a/src/Row_IOE.h b/src/Row_IOE.h index 4981bf8..f607ff9 100644 --- a/src/Row_IOE.h +++ b/src/Row_IOE.h @@ -39,9 +39,9 @@ class Row_IOE : public RowBase Debouncer_4Samples debouncer; public: Row_IOE( RowPort& refRowPort, const uint8_t strobePin, - ColPort& refColPort, Key *const ptrsKeys[]) + ColPort& refColPort, Key *const ptrsKeys[], const uint8_t KEY_COUNT) : RowBase(ptrsKeys), scanner(refRowPort, strobePin, refColPort) { } void process(); - uint8_t getRowState(ColPort* refColPort, read_pins_mask_t& rowEnd); + uint8_t getRowState(ColPort* ptrColPort, uint8_t& KEY_COUNT); }; #endif