add some fixes

This commit is contained in:
MX
2026-02-05 01:09:41 +03:00
parent 88449f1b8d
commit dc886f9053
4 changed files with 12 additions and 6 deletions
+4
View File
@@ -317,6 +317,10 @@ bool protopirate_decoder_init(ProtoPirateApp* app) {
FURI_LOG_D(TAG, "Decoder already initialized");
return true;
}
if(app->radio_initialized) {
FURI_LOG_D(TAG, "Radio already initialized, skipping decoder init");
return true;
}
LOG_HEAP("Decoder init start");
+1 -1
View File
@@ -4,7 +4,7 @@
#include <lib/subghz/receiver.h>
#include <lib/subghz/protocols/base.h>
#define PROTOPIRATE_HISTORY_MAX 50
#define PROTOPIRATE_HISTORY_MAX 20
typedef struct ProtoPirateHistory ProtoPirateHistory;
+7 -4
View File
@@ -3,8 +3,8 @@
#include "../helpers/protopirate_storage.h"
#include <notification/notification_messages.h>
#define TAG "ProtoPirateSceneRx"
#define KIA_DISPLAY_HISTORY_MAX 20 // Reduced from 50 to save memory
#define TAG "ProtoPirateSceneRx"
#define PROTOPIRATE_DISPLAY_HISTORY_MAX 20 // Reduced from 50 to save memory
// Forward declaration
void protopirate_scene_receiver_view_callback(ProtoPirateCustomEvent event, void* context);
@@ -29,13 +29,13 @@ static void protopirate_scene_receiver_update_statusbar(void* context) {
history_stat_str,
"A%u/%u",
protopirate_history_get_item(app->txrx->history),
KIA_DISPLAY_HISTORY_MAX);
PROTOPIRATE_DISPLAY_HISTORY_MAX);
} else {
furi_string_printf(
history_stat_str,
"%u/%u",
protopirate_history_get_item(app->txrx->history),
KIA_DISPLAY_HISTORY_MAX);
PROTOPIRATE_DISPLAY_HISTORY_MAX);
}
// Pass actual external radio status
@@ -299,6 +299,9 @@ void protopirate_scene_receiver_on_exit(void* context) {
if(app->radio_initialized && app->txrx->history) {
protopirate_history_reset(app->txrx->history);
}
// Deinitialize radio to free up memory
protopirate_radio_deinit(app);
}
void protopirate_scene_receiver_view_callback(ProtoPirateCustomEvent event, void* context) {
-1
View File
@@ -18,7 +18,6 @@
#define SAMPLES_TO_READ_PER_TICK 400
#define SUCCESS_DISPLAY_TICKS 18
#define FAILURE_DISPLAY_TICKS 18
#define PROTOPIRATE_HISTORY_MAX 50
// Decode state machine
typedef enum {