From e06668f042e4b4646f6eab298374fd8f062c7a7f Mon Sep 17 00:00:00 2001 From: Asbelos Date: Mon, 26 Dec 2022 10:09:34 +0000 Subject: [PATCH] speedup --- IO_duinoNodes.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/IO_duinoNodes.h b/IO_duinoNodes.h index 9228d0e..ae7d40c 100644 --- a/IO_duinoNodes.h +++ b/IO_duinoNodes.h @@ -70,23 +70,22 @@ void _loopInput(unsigned long currentMicros) { //set latch to HIGH to freeze & store parallel data ArduinoPins::fastWriteDigital(_latchPin, HIGH); - delayMicroseconds(50); + delayMicroseconds(1); //set latch to LOW to enable the data to be transmitted serially ArduinoPins::fastWriteDigital(_latchPin, LOW); - delayMicroseconds(50); // stream in the bitmap using mapping order provided at constructor for (int xmitByte=0;xmitByte<_nShiftBytes; xmitByte++) { byte newByte=0; for (int xmitBit=0;xmitBit<8; xmitBit++) { ArduinoPins::fastWriteDigital(_clockPin, LOW); - delayMicroseconds(20); + delayMicroseconds(1); bool data = ArduinoPins::fastReadDigital(_dataPin); byte map=_pinMap[xmitBit]; if (data) newByte |= map; else newByte &= ~map; ArduinoPins::fastWriteDigital(_clockPin, HIGH); - delayMicroseconds(20); + delayMicroseconds(1); } _pinValues[xmitByte]=newByte; // DIAG(F("DIN %x=%x"),xmitByte, newByte);