From 84e7a703620d68f95f97e321973a2baa2a363384 Mon Sep 17 00:00:00 2001 From: Xavier Date: Mon, 22 Jan 2024 20:25:44 -0500 Subject: [PATCH] automatically supply GPIO power when using read functions to turn on reader --- gpio/wiegand/scenes/wiegand_read.c | 1 + gpio/wiegand/scenes/wiegand_scan.c | 1 + 2 files changed, 2 insertions(+) diff --git a/gpio/wiegand/scenes/wiegand_read.c b/gpio/wiegand/scenes/wiegand_read.c index 16863eb..49ea798 100644 --- a/gpio/wiegand/scenes/wiegand_read.c +++ b/gpio/wiegand/scenes/wiegand_read.c @@ -49,6 +49,7 @@ void wiegand_start_read(void *context) App *app = context; data_saved = false; bit_count = 0; + furi_hal_power_enable_otg(); furi_hal_gpio_init_simple(pinD0, GpioModeInterruptRiseFall); furi_hal_gpio_init_simple(pinD1, GpioModeInterruptRiseFall); furi_hal_gpio_add_int_callback(pinD0, wiegand_isr_d0, NULL); diff --git a/gpio/wiegand/scenes/wiegand_scan.c b/gpio/wiegand/scenes/wiegand_scan.c index a745741..de74bbf 100644 --- a/gpio/wiegand/scenes/wiegand_scan.c +++ b/gpio/wiegand/scenes/wiegand_scan.c @@ -51,6 +51,7 @@ static void wiegand_start_scan(void *context) UNUSED(context); data_saved = false; bit_count = 0; + furi_hal_power_enable_otg(); furi_hal_gpio_init_simple(pinD0, GpioModeInterruptRiseFall); furi_hal_gpio_init_simple(pinD1, GpioModeInterruptRiseFall); furi_hal_gpio_add_int_callback(pinD0, wiegand_scan_isr_d0, NULL);