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

Port timer priority changes from fw repo

Willy-JL 2 лет назад
Родитель
Сommit
565584f930

+ 2 - 3
brainfuck/brainfuck.c

@@ -117,15 +117,14 @@ void brainfuck_free(BFApp* brainfuck) {
 
 void brainfuck_show_loading_popup(void* context, bool show) {
     BFApp* brainfuck = context;
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
 
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(brainfuck->view_dispatcher, brainfuckViewLoading);
     } else {
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }
 

+ 2 - 3
evil_portal/scenes/evil_portal_scene_select_html.c

@@ -2,17 +2,16 @@
 #include "../helpers/evil_portal_storage.h"
 
 void evil_portal_show_loading_popup(Evil_PortalApp* app, bool show) {
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
     ViewStack* view_stack = app->view_stack;
     Loading* loading = app->loading;
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_stack_add_view(view_stack, loading_get_view(loading));
     } else {
         view_stack_remove_view(view_stack, loading_get_view(loading));
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }
 

+ 2 - 3
magspoof/mag.c

@@ -235,14 +235,13 @@ void mag_text_input_callback(void* context) {
 
 void mag_show_loading_popup(void* context, bool show) {
     Mag* mag = context;
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
 
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(mag->view_dispatcher, MagViewLoading);
     } else {
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }

+ 2 - 4
mass_storage/mass_storage_app.c

@@ -22,15 +22,13 @@ static void mass_storage_app_tick_event_callback(void* context) {
 }
 
 void mass_storage_app_show_loading_popup(MassStorageApp* app, bool show) {
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
-
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(app->view_dispatcher, MassStorageAppViewLoading);
     } else {
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }
 

+ 2 - 3
mifare_nested/mifare_nested.c

@@ -21,15 +21,14 @@ void mifare_nested_tick_event_callback(void* context) {
 
 void mifare_nested_show_loading_popup(void* context, bool show) {
     MifareNested* mifare_nested = context;
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
 
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(mifare_nested->view_dispatcher, MifareNestedViewLoading);
     } else {
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }
 

+ 2 - 3
nfc_magic/nfc_magic_app.c

@@ -23,15 +23,14 @@ void nfc_magic_app_tick_event_callback(void* context) {
 
 void nfc_magic_app_show_loading_popup(void* context, bool show) {
     NfcMagicApp* instance = context;
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
 
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(instance->view_dispatcher, NfcMagicAppViewLoading);
     } else {
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }
 

+ 2 - 3
picopass/picopass.c

@@ -196,15 +196,14 @@ void picopass_blink_stop(Picopass* picopass) {
 
 void picopass_show_loading_popup(void* context, bool show) {
     Picopass* picopass = context;
-    TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
 
     if(show) {
         // Raise timer priority so that animations can play
-        vTaskPrioritySet(timer_task, configMAX_PRIORITIES - 1);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityElevated);
         view_dispatcher_switch_to_view(picopass->view_dispatcher, PicopassViewLoading);
     } else {
         // Restore default timer priority
-        vTaskPrioritySet(timer_task, configTIMER_TASK_PRIORITY);
+        furi_timer_set_thread_priority(FuriTimerThreadPriorityNormal);
     }
 }