Seems we have cross-thread violation

This commit is contained in:
DerSkythe
2022-10-08 22:54:30 +04:00
parent b86f42e7fb
commit 7643fdad7c
4 changed files with 35 additions and 8 deletions
@@ -57,7 +57,7 @@ bool subbrute_scene_run_attack_on_event(void* context, SceneManagerEvent event)
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
subbrute_attack_view_set_current_step(view, subbrute_device_get_step(instance->device));
subbrute_attack_view_set_current_step(view, subbrute_get_step(instance));
if(event.event == SubBruteCustomEventTypeTransmitFinished) {
notification_message(instance->notifications, &sequence_display_backlight_on);
@@ -77,7 +77,7 @@ bool subbrute_scene_run_attack_on_event(void* context, SceneManagerEvent event)
}
consumed = true;
} else if(event.type == SceneManagerEventTypeTick) {
subbrute_attack_view_set_current_step(view, subbrute_device_get_step(instance->device));
subbrute_attack_view_set_current_step(view, subbrute_get_step(instance));
consumed = true;
}
+7
View File
@@ -163,6 +163,13 @@ void subbrute_popup_closed_callback(void* context) {
instance->view_dispatcher, SubBruteCustomEventTypePopupClosed);
}
uint64_t subbrute_get_step(void* context) {
furi_assert(context);
SubBruteState* instance = context;
return subbrute_device_get_step(instance->device);
}
// ENTRYPOINT
int32_t subbrute_app(void* p) {
UNUSED(p);
@@ -1,5 +1,4 @@
#include "subbrute_device.h"
//#include "subbrute_device.h"
#include <stdint.h>
#include <storage/storage.h>
@@ -46,7 +45,7 @@ SubBruteDevice* subbrute_device_alloc() {
instance->receiver = NULL;
instance->environment = subghz_environment_alloc();
subbrute_device_attack_set_default_values(instance, SubBruteAttackCAME12bit307);
subbrute_device_attack_set_default_values(instance, SubBruteAttackCAME12bit433);
return instance;
}
@@ -274,6 +273,23 @@ bool subbrute_device_transmit_current_key(SubBruteDevice* instance) {
}
instance->last_time_tx_data = ticks;
#ifdef FURI_DEBUG
if(instance->attack == SubBruteAttackLoadFile) {
FURI_LOG_D(
TAG,
"Protocol: %d, Frequency: %ld",
instance->file_protocol_info->file,
instance->file_protocol_info->frequency);
} else {
FURI_LOG_D(
TAG,
"Protocol: %d, Frequency: %ld",
instance->protocol_info->file,
instance->protocol_info->frequency);
}
#endif
FlipperFormat* flipper_format = flipper_format_string_alloc();
if(!subbrute_device_create_packet_parsed(instance, flipper_format, instance->key_index, true)) {
@@ -328,7 +344,7 @@ bool subbrute_device_save_file(SubBruteDevice* instance, const char* dev_file_na
}
if(!subbrute_device_create_packet_parsed(instance, file, instance->key_index, false)) {
FURI_LOG_E(TAG, "subbrute_device_create_packet_parsed failed!");
FURI_LOG_E(TAG, "create_packet_parsed failed!");
break;
}
@@ -461,7 +477,7 @@ bool subbrute_device_create_packet_parsed(
}
}
#ifdef FURI_DEBUG
//FURI_LOG_D(TAG, "payload: %s", instance->payload);
FURI_LOG_D(TAG, "candidate: %s", furi_string_get_cstr(candidate));
#endif
}
@@ -545,7 +561,10 @@ SubBruteFileResult subbrute_device_attack_set(SubBruteDevice* instance, SubBrute
instance->protocol_info->bits);
#ifdef FURI_DEBUG
FURI_LOG_D(
TAG, "tail: %d, file_template: %s", instance->protocol_info->te, instance->file_template);
TAG,
"tail: %d, file_template: %s",
instance->protocol_info->te,
instance->file_template);
#endif
}
+2 -1
View File
@@ -66,4 +66,5 @@ struct SubBruteState {
void subbrute_show_loading_popup(void* context, bool show);
void subbrute_text_input_callback(void* context);
void subbrute_popup_closed_callback(void* context);
void subbrute_popup_closed_callback(void* context);
uint64_t subbrute_get_step(void* context);