move debouncer.debounce() to Row::process()
This commit is contained in:
parent
ff5f50db5f
commit
11f20376b7
@ -17,11 +17,7 @@ void Row::process(const bool activeHigh)
|
|||||||
wait();
|
wait();
|
||||||
scan(activeHigh); //save column-port-pin values to portState
|
scan(activeHigh); //save column-port-pin values to portState
|
||||||
rowState = getRowState(rowEnd, activeHigh);
|
rowState = getRowState(rowEnd, activeHigh);
|
||||||
debouncedChanged = debounce(rowState);
|
//debouncedChanged = debounce(rowState);
|
||||||
|
debouncedChanged = debouncer.debounce(rowState, debounced);
|
||||||
pressRelease(rowEnd, debouncedChanged);
|
pressRelease(rowEnd, debouncedChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Row::debounce(const uint8_t rowState)
|
|
||||||
{
|
|
||||||
return debouncer.debounce(rowState, debounced);
|
|
||||||
}
|
|
||||||
|
@ -18,7 +18,6 @@ class Row : public RowBase
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
Debouncer_4Samples debouncer;
|
Debouncer_4Samples debouncer;
|
||||||
virtual uint8_t debounce(const uint8_t rowState);
|
|
||||||
public:
|
public:
|
||||||
Row( RowPort &refRowPort, const uint8_t rowPin,
|
Row( RowPort &refRowPort, const uint8_t rowPin,
|
||||||
ColPort *const ptrsColPorts[], const uint8_t colPortCount, Key *const ptrsKeys[])
|
ColPort *const ptrsColPorts[], const uint8_t colPortCount, Key *const ptrsKeys[])
|
||||||
|
@ -27,7 +27,6 @@ class RowBase
|
|||||||
void wait();
|
void wait();
|
||||||
void scan(const bool activeHigh);
|
void scan(const bool activeHigh);
|
||||||
uint8_t getRowState(uint16_t& rowEnd, const bool activeHigh);
|
uint8_t getRowState(uint16_t& rowEnd, const bool activeHigh);
|
||||||
virtual uint8_t debounce(const uint8_t rowState)=0;
|
|
||||||
void pressRelease(const uint16_t rowEnd, const uint8_t debouncedChanged);
|
void pressRelease(const uint16_t rowEnd, const uint8_t debouncedChanged);
|
||||||
public:
|
public:
|
||||||
RowBase( RowPort &refRowPort, const uint8_t rowPin,
|
RowBase( RowPort &refRowPort, const uint8_t rowPin,
|
||||||
|
Reference in New Issue
Block a user