From 087ddbcf663921f16abcf053aa0ae64c8d03b483 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Thu, 1 Feb 2024 03:14:41 +0000 Subject: [PATCH] Forgor to fix expansion in subghz gps --- applications/main/subghz/helpers/subghz_gps.c | 6 ++++++ applications/main/subghz/helpers/subghz_gps.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/applications/main/subghz/helpers/subghz_gps.c b/applications/main/subghz/helpers/subghz_gps.c index 64538b70c..de34d8b77 100644 --- a/applications/main/subghz/helpers/subghz_gps.c +++ b/applications/main/subghz/helpers/subghz_gps.c @@ -131,6 +131,9 @@ SubGhzGPS* subghz_gps_init() { furi_thread_set_context(subghz_gps->thread, subghz_gps); furi_thread_set_callback(subghz_gps->thread, subghz_gps_uart_worker); + subghz_gps->expansion = furi_record_open(RECORD_EXPANSION); + expansion_disable(subghz_gps->expansion); + subghz_gps->serial_handle = furi_hal_serial_control_acquire(UART_CH); furi_check(subghz_gps->serial_handle); furi_hal_serial_init(subghz_gps->serial_handle, 9600); @@ -147,6 +150,9 @@ void subghz_gps_deinit(SubGhzGPS* subghz_gps) { furi_hal_serial_deinit(subghz_gps->serial_handle); furi_hal_serial_control_release(subghz_gps->serial_handle); + expansion_enable(subghz_gps->expansion); + furi_record_close(RECORD_EXPANSION); + furi_thread_free(subghz_gps->thread); furi_stream_buffer_free(subghz_gps->rx_stream); diff --git a/applications/main/subghz/helpers/subghz_gps.h b/applications/main/subghz/helpers/subghz_gps.h index 580e1b0dc..7475cd2c0 100644 --- a/applications/main/subghz/helpers/subghz_gps.h +++ b/applications/main/subghz/helpers/subghz_gps.h @@ -1,5 +1,6 @@ #include #include +#include #define UART_CH (xtreme_settings.uart_nmea_channel) @@ -13,6 +14,7 @@ typedef enum { #define WORKER_ALL_RX_EVENTS (WorkerEvtStop | WorkerEvtRxDone) typedef struct { + Expansion* expansion; FuriThread* thread; FuriStreamBuffer* rx_stream; uint8_t rx_buf[RX_BUF_SIZE];