fixed bug with power suppress in unirf, removed icon from api

This commit is contained in:
MX
2022-09-19 05:22:50 +03:00
parent d85731636f
commit 181533df1b
2 changed files with 14 additions and 11 deletions

View File

@@ -845,6 +845,8 @@ void unirfremix_subghz_alloc(UniRFRemix* app) {
UniRFRemix* unirfremix_alloc(void) { UniRFRemix* unirfremix_alloc(void) {
UniRFRemix* app = malloc(sizeof(UniRFRemix)); UniRFRemix* app = malloc(sizeof(UniRFRemix));
furi_hal_power_suppress_charge_enter();
app->model_mutex = furi_mutex_alloc(FuriMutexTypeNormal); app->model_mutex = furi_mutex_alloc(FuriMutexTypeNormal);
app->input_queue = furi_message_queue_alloc(32, sizeof(InputEvent)); app->input_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
@@ -862,7 +864,9 @@ UniRFRemix* unirfremix_alloc(void) {
return app; return app;
} }
void unirfremix_free(UniRFRemix* app) { void unirfremix_free(UniRFRemix* app, bool with_subghz) {
furi_hal_power_suppress_charge_exit();
string_clear(app->up_file); string_clear(app->up_file);
string_clear(app->down_file); string_clear(app->down_file);
string_clear(app->left_file); string_clear(app->left_file);
@@ -888,10 +892,12 @@ void unirfremix_free(UniRFRemix* app) {
furi_mutex_free(app->model_mutex); furi_mutex_free(app->model_mutex);
furi_hal_subghz_sleep(); if(with_subghz) {
subghz_setting_free(app->setting); furi_hal_subghz_sleep();
subghz_receiver_free(app->subghz_receiver); subghz_setting_free(app->setting);
subghz_environment_free(app->environment); subghz_receiver_free(app->subghz_receiver);
subghz_environment_free(app->environment);
}
furi_record_close(RECORD_NOTIFICATION); furi_record_close(RECORD_NOTIFICATION);
app->notification = NULL; app->notification = NULL;
@@ -939,6 +945,8 @@ int32_t unirfremix_app(void* p) {
furi_record_close(RECORD_DIALOGS); furi_record_close(RECORD_DIALOGS);
if(!res) { if(!res) {
FURI_LOG_E(TAG, "No file selected"); FURI_LOG_E(TAG, "No file selected");
unirfremix_free(app, false);
return 255;
} else { } else {
//check map and population variables //check map and population variables
unirfremix_cfg_set_check(app, app->file_path); unirfremix_cfg_set_check(app, app->file_path);
@@ -970,8 +978,6 @@ int32_t unirfremix_app(void* p) {
furi_mutex_release(app->model_mutex); furi_mutex_release(app->model_mutex);
view_port_update(app->view_port); view_port_update(app->view_port);
furi_hal_power_suppress_charge_enter();
//input detect loop start //input detect loop start
InputEvent input; InputEvent input;
while(1) { while(1) {
@@ -1164,9 +1170,7 @@ int32_t unirfremix_app(void* p) {
} }
// remove & free all stuff created by app // remove & free all stuff created by app
unirfremix_free(app); unirfremix_free(app, true);
furi_hal_power_suppress_charge_exit();
return 0; return 0;
} }

View File

@@ -4090,7 +4090,6 @@ Variable,+,A_NFC_14,const Icon,
Variable,+,A_Plugins_14,const Icon, Variable,+,A_Plugins_14,const Icon,
Variable,+,A_Round_loader_8x8,const Icon, Variable,+,A_Round_loader_8x8,const Icon,
Variable,+,A_Settings_14,const Icon, Variable,+,A_Settings_14,const Icon,
Variable,+,A_SpectrumAnalyzer_14,const Icon,
Variable,+,A_Sub1ghz_14,const Icon, Variable,+,A_Sub1ghz_14,const Icon,
Variable,+,A_U2F_14,const Icon, Variable,+,A_U2F_14,const Icon,
Variable,+,A_UniRFRemix_14,const Icon, Variable,+,A_UniRFRemix_14,const Icon,
1 entry status name type params
4090 Variable + A_Plugins_14 const Icon
4091 Variable + A_Round_loader_8x8 const Icon
4092 Variable + A_Settings_14 const Icon
Variable + A_SpectrumAnalyzer_14 const Icon
4093 Variable + A_Sub1ghz_14 const Icon
4094 Variable + A_U2F_14 const Icon
4095 Variable + A_UniRFRemix_14 const Icon