[FL-2284] IR: Show universal remote loading (#1004)

* [FL-2131] IR: Show universal remote loading
* Remove unused hal rtc. Gui: cleanup loading module.

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Albert Kharisov
2022-02-24 15:59:36 +04:00
committed by GitHub
parent 92734f1bb3
commit 24987b95cd
32 changed files with 409 additions and 243 deletions
@@ -1,3 +1,6 @@
#include <stdint.h>
#include <gui/modules/loading.h>
#include <gui/view_stack.h>
#include "irda/scene/irda_app_scene.h"
#include "irda/irda_app.h"
@@ -80,9 +83,32 @@ void IrdaAppSceneUniversalTV::on_enter(IrdaApp* app) {
button_panel_add_label(button_panel, 9, 64, FontSecondary, "Vol");
button_panel_add_label(button_panel, 43, 64, FontSecondary, "Ch");
view_manager->switch_to(IrdaAppViewManager::ViewType::ButtonPanel);
view_manager->switch_to(IrdaAppViewManager::ViewType::UniversalRemote);
if(!brute_force.calculate_messages()) {
auto stack_view = app->get_view_manager()->get_universal_view_stack();
auto loading_view = app->get_view_manager()->get_loading();
view_stack_add_view(stack_view, loading_get_view(loading_view));
/**
* Problem: Update events are not handled in Loading View, because:
* 1) Timer task has least prio
* 2) Storage service uses drivers that capture whole CPU time
* to handle SD communication
*
* Ugly workaround, but it works for current situation:
* raise timer task prio for DB scanning period.
*/
TaskHandle_t timer_task = xTaskGetHandle(configTIMER_SERVICE_TASK_NAME);
TaskHandle_t storage_task = xTaskGetHandle("StorageSrv");
uint32_t timer_prio = uxTaskPriorityGet(timer_task);
uint32_t storage_prio = uxTaskPriorityGet(storage_task);
vTaskPrioritySet(timer_task, storage_prio + 1);
bool result = brute_force.calculate_messages();
vTaskPrioritySet(timer_task, timer_prio);
view_stack_remove_view(stack_view, loading_get_view(loading_view));
if(!result) {
app->switch_to_previous_scene();
}
}