From 4f892abe87645ad142d3dedcd305ecc39dfe95d1 Mon Sep 17 00:00:00 2001 From: bemabalu <84475320+bemabalu@users.noreply.github.com> Date: Wed, 4 Sep 2024 22:59:49 +0200 Subject: [PATCH] quick and dirty fix for falling edges in type2 as i can't test this with an improved script like for type 1 as i don't have this device --- src/type2/CollarRxType2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/type2/CollarRxType2.cpp b/src/type2/CollarRxType2.cpp index 96643f7..2cad148 100644 --- a/src/type2/CollarRxType2.cpp +++ b/src/type2/CollarRxType2.cpp @@ -99,6 +99,7 @@ bool CollarRxType2::buffer_to_collar_message(const uint8_t buffer[5], struct col void CollarRxType2::isr() { + if (digitalRead(_rx_pin)==0) return; //quick and dirty don't check falling edges as interrupt is fired on signal change now static unsigned long rx_micros =0; static uint8_t pulse_count = 0; delayMicroseconds(500); // BAD: really shouldn't do this in an ISR