Просмотр исходного кода

BleSpam: Fix hang on lock keyboard

Willy-JL 1 год назад
Родитель
Сommit
a7126650c2
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      ble_spam/ble_spam.c

+ 3 - 0
ble_spam/ble_spam.c

@@ -491,12 +491,14 @@ static bool input_callback(InputEvent* input, void* _ctx) {
         consumed = true;
         consumed = true;
         state->lock_warning = true;
         state->lock_warning = true;
         if(state->lock_count == 0) {
         if(state->lock_count == 0) {
+            furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
             furi_timer_start(state->lock_timer, 1000);
             furi_timer_start(state->lock_timer, 1000);
         }
         }
         if(input->type == InputTypeShort && input->key == InputKeyBack) {
         if(input->type == InputTypeShort && input->key == InputKeyBack) {
             state->lock_count++;
             state->lock_count++;
         }
         }
         if(state->lock_count >= 3) {
         if(state->lock_count >= 3) {
+            furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
             furi_timer_start(state->lock_timer, 1);
             furi_timer_start(state->lock_timer, 1);
         }
         }
     } else if(
     } else if(
@@ -614,6 +616,7 @@ static void lock_timer_callback(void* _ctx) {
     with_view_model(
     with_view_model(
         state->main_view, State * *model, { (*model)->lock_warning = false; }, true);
         state->main_view, State * *model, { (*model)->lock_warning = false; }, true);
     state->lock_count = 0;
     state->lock_count = 0;
+    furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
 }
 }
 
 
 static void tick_event_callback(void* _ctx) {
 static void tick_event_callback(void* _ctx) {