Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d376972

Browse files
committed
Add small delay in ButtonMatrix for non-AVR boards
1 parent b82200c commit d376972

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/AH/Hardware/ButtonMatrix.ipp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ void ButtonMatrix<Derived, NumRows, NumCols>::update() {
2222

2323
for (size_t row = 0; row < NumRows; row++) { // scan through all rows
2424
pinMode(rowPins[row], OUTPUT); // make the current row Lo-Z 0V
25+
#if !defined(__AVR__) && !defined(__x86_64__)
26+
delayMicroseconds(1);
27+
#endif
2528
for (size_t col = 0; col < NumCols; col++) { // scan through all columns
2629
bool state = digitalRead(colPins[col]); // read the state
2730
if (state != getPrevState(col, row)) {

src/AH/Hardware/ExtendedInputOutput/AnalogMultiplex.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void AnalogMultiplex<N>::setMuxAddress(uint8_t address) {
253253
mask <<= 1;
254254
}
255255
#if !defined(__AVR__) && !defined(__x86_64__)
256-
delayMicroseconds(5);
256+
delayMicroseconds(1);
257257
#endif
258258
}
259259

0 commit comments

Comments
 (0)