Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions WiegandNG.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#include <WiegandNG.h>
#if defined(ESP8266)
#define INTERRUPT_ATTR ICACHE_RAM_ATTR
#else
#define INTERRUPT_ATTR
#endif

// pcintbranch

Expand Down Expand Up @@ -86,13 +91,13 @@ bool WiegandNG::available() {
return ret;
}

void WiegandNG::ReadD0 () {
INTERRUPT_ATTR void WiegandNG::ReadD0 () {
_bitCounted++; // increment bit count for Interrupt connected to D0
shift_left(_buffer,_bufferSize,1); // shift 0 into buffer
_lastPulseTime = millis(); // keep track of time last wiegand bit received
}

void WiegandNG::ReadD1() {
INTERRUPT_ATTR void WiegandNG::ReadD1() {
_bitCounted++; // increment bit count for Interrupt connected to D1
if (_bitCounted > (_bufferSize * 8)) {
_bitCounted=0; // overflowed,
Expand Down