From a02aa4209521117ebc838103961fbb20cc741abf Mon Sep 17 00:00:00 2001 From: SG Date: Tue, 18 May 2021 23:51:14 +1000 Subject: [PATCH] HAL LFRFID: fix resistor heating on f5 target (#470) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- applications/lf-rfid/helpers/rfid-timer-emulator.cpp | 4 ++-- firmware/targets/f5/api-hal/api-hal-rfid.c | 10 +++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/applications/lf-rfid/helpers/rfid-timer-emulator.cpp b/applications/lf-rfid/helpers/rfid-timer-emulator.cpp index 5cf1f07e..4fcd556f 100644 --- a/applications/lf-rfid/helpers/rfid-timer-emulator.cpp +++ b/applications/lf-rfid/helpers/rfid-timer-emulator.cpp @@ -53,10 +53,10 @@ void RfidTimerEmulator::start(Type type) { void RfidTimerEmulator::stop() { api_hal_rfid_tim_emulate_stop(); + api_interrupt_remove(timer_update_callback, InterruptTypeTimerUpdate); + api_hal_rfid_tim_reset(); api_hal_rfid_pins_reset(); - - api_interrupt_remove(timer_update_callback, InterruptTypeTimerUpdate); } void RfidTimerEmulator::timer_update_callback(void* _hw, void* ctx) { diff --git a/firmware/targets/f5/api-hal/api-hal-rfid.c b/firmware/targets/f5/api-hal/api-hal-rfid.c index ed8954a3..d8067d63 100644 --- a/firmware/targets/f5/api-hal/api-hal-rfid.c +++ b/firmware/targets/f5/api-hal/api-hal-rfid.c @@ -11,13 +11,9 @@ void api_hal_rfid_pins_reset() { // ibutton bus disable api_hal_ibutton_stop(); - // pulldown rfid antenna - hal_gpio_init(&gpio_rfid_carrier_out, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); - hal_gpio_write(&gpio_rfid_carrier_out, true); - - // from both sides - hal_gpio_init(&gpio_rfid_pull, GpioModeOutputPushPull, GpioSpeedLow, GpioPullNo); - hal_gpio_write(&gpio_rfid_pull, false); + // rfid pins disable + hal_gpio_init(&gpio_rfid_carrier_out, GpioModeAnalog, GpioSpeedLow, GpioPullNo); + hal_gpio_init(&gpio_rfid_pull, GpioModeAnalog, GpioSpeedLow, GpioPullNo); } void api_hal_rfid_pins_emulate() {