automatically supply GPIO power when using read functions to turn on reader

This commit is contained in:
Xavier 2024-01-22 20:25:44 -05:00
parent 6d812948f3
commit 84e7a70362
2 changed files with 2 additions and 0 deletions

View File

@ -49,6 +49,7 @@ void wiegand_start_read(void *context)
App *app = context; App *app = context;
data_saved = false; data_saved = false;
bit_count = 0; bit_count = 0;
furi_hal_power_enable_otg();
furi_hal_gpio_init_simple(pinD0, GpioModeInterruptRiseFall); furi_hal_gpio_init_simple(pinD0, GpioModeInterruptRiseFall);
furi_hal_gpio_init_simple(pinD1, GpioModeInterruptRiseFall); furi_hal_gpio_init_simple(pinD1, GpioModeInterruptRiseFall);
furi_hal_gpio_add_int_callback(pinD0, wiegand_isr_d0, NULL); furi_hal_gpio_add_int_callback(pinD0, wiegand_isr_d0, NULL);

View File

@ -51,6 +51,7 @@ static void wiegand_start_scan(void *context)
UNUSED(context); UNUSED(context);
data_saved = false; data_saved = false;
bit_count = 0; bit_count = 0;
furi_hal_power_enable_otg();
furi_hal_gpio_init_simple(pinD0, GpioModeInterruptRiseFall); furi_hal_gpio_init_simple(pinD0, GpioModeInterruptRiseFall);
furi_hal_gpio_init_simple(pinD1, GpioModeInterruptRiseFall); furi_hal_gpio_init_simple(pinD1, GpioModeInterruptRiseFall);
furi_hal_gpio_add_int_callback(pinD0, wiegand_scan_isr_d0, NULL); furi_hal_gpio_add_int_callback(pinD0, wiegand_scan_isr_d0, NULL);