From a9083561fa5e3ea50b2d7104457e57da806e9cc2 Mon Sep 17 00:00:00 2001 From: gornekich Date: Wed, 19 May 2021 15:23:34 +0300 Subject: [PATCH] [FL-1318] Fix cyfral and metakom keys reading (#474) --- applications/ibutton/helpers/key-reader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applications/ibutton/helpers/key-reader.cpp b/applications/ibutton/helpers/key-reader.cpp index 8955c647c..1b3a9b85d 100644 --- a/applications/ibutton/helpers/key-reader.cpp +++ b/applications/ibutton/helpers/key-reader.cpp @@ -142,8 +142,10 @@ void KeyReader::comparator_trigger_callback(void* hcomp, void* comp_ctx) { if(hcomp == &hcomp1) { uint32_t current_dwt_value = DWT->CYCCNT; - _this->cyfral_decoder.process_front(hal_gpio_get_rfid_in_level(), current_dwt_value); - _this->metakom_decoder.process_front(hal_gpio_get_rfid_in_level(), current_dwt_value); + _this->cyfral_decoder.process_front( + hal_gpio_get_rfid_in_level(), current_dwt_value - last_dwt_value); + _this->metakom_decoder.process_front( + hal_gpio_get_rfid_in_level(), current_dwt_value - last_dwt_value); last_dwt_value = DWT->CYCCNT; }