diff --git a/applications/gui/elements.c b/applications/gui/elements.c index fe95102b..4fbafbd5 100644 --- a/applications/gui/elements.c +++ b/applications/gui/elements.c @@ -27,18 +27,12 @@ typedef struct { const char* text; } ElementTextBoxLine; -void elements_progress_bar( - Canvas* canvas, - uint8_t x, - uint8_t y, - uint8_t width, - uint8_t progress, - uint8_t total) { +void elements_progress_bar(Canvas* canvas, uint8_t x, uint8_t y, uint8_t width, float progress) { furi_assert(canvas); - furi_assert(total > 0); + furi_assert((progress >= 0) && (progress <= 1.0)); uint8_t height = 9; - uint8_t progress_length = roundf(((float)progress / total) * (width - 2)); + uint8_t progress_length = roundf(progress * (width - 2)); canvas_set_color(canvas, ColorWhite); canvas_draw_box(canvas, x + 1, y + 1, width - 2, height - 2); diff --git a/applications/gui/elements.h b/applications/gui/elements.h index 28010b36..33b5fc66 100644 --- a/applications/gui/elements.h +++ b/applications/gui/elements.h @@ -27,16 +27,9 @@ extern "C" { * @param x progress bar position on X axis * @param y progress bar position on Y axis * @param width progress bar width - * @param progress progress in unnamed metric - * @param total total amount in unnamed metric + * @param progress progress (0.0 - 1.0) */ -void elements_progress_bar( - Canvas* canvas, - uint8_t x, - uint8_t y, - uint8_t width, - uint8_t progress, - uint8_t total); +void elements_progress_bar(Canvas* canvas, uint8_t x, uint8_t y, uint8_t width, float progress); /** Draw scrollbar on canvas at specific position. * diff --git a/applications/gui/modules/button_panel.c b/applications/gui/modules/button_panel.c index 07bb6b62..c2328d20 100644 --- a/applications/gui/modules/button_panel.c +++ b/applications/gui/modules/button_panel.c @@ -40,8 +40,6 @@ ARRAY_DEF(ButtonMatrix, ButtonArray_t); struct ButtonPanel { View* view; - ButtonPanelInputCallback input_callback; - void* input_context; }; typedef struct { @@ -51,8 +49,6 @@ typedef struct { uint16_t reserve_y; uint16_t selected_item_x; uint16_t selected_item_y; - ButtonPanelDrawCallback draw_callback; - void* draw_context; } ButtonPanelModel; static ButtonItem** button_panel_get_item(ButtonPanelModel* model, size_t x, size_t y); @@ -72,7 +68,6 @@ ButtonPanel* button_panel_alloc() { view_allocate_model(button_panel->view, ViewModelTypeLocking, sizeof(ButtonPanelModel)); view_set_draw_callback(button_panel->view, button_panel_view_draw_callback); view_set_input_callback(button_panel->view, button_panel_view_input_callback); - button_panel->input_callback = NULL; with_view_model( button_panel->view, (ButtonPanelModel * model) { @@ -80,7 +75,6 @@ ButtonPanel* button_panel_alloc() { model->reserve_y = 0; model->selected_item_x = 0; model->selected_item_y = 0; - model->draw_callback = NULL; ButtonMatrix_init(model->button_matrix); LabelList_init(model->labels); return true; @@ -216,8 +210,6 @@ static void button_panel_view_draw_callback(Canvas* canvas, void* _model) { canvas_set_font(canvas, label->font); canvas_draw_str(canvas, label->x, label->y, label->str); } - - if(model->draw_callback) model->draw_callback(canvas, model->draw_context); } static void button_panel_process_down(ButtonPanel* button_panel) { @@ -341,9 +333,7 @@ static bool button_panel_view_input_callback(InputEvent* event, void* context) { furi_assert(button_panel); bool consumed = false; - if(button_panel->input_callback) { - consumed = button_panel->input_callback(event, button_panel->input_context); - } else if(event->type == InputTypeShort) { + if(event->type == InputTypeShort) { switch(event->key) { case InputKeyUp: consumed = true; @@ -391,23 +381,3 @@ void button_panel_add_label( return true; }); } - -void button_panel_set_popup_draw_callback( - ButtonPanel* button_panel, - ButtonPanelDrawCallback callback, - void* context) { - with_view_model( - button_panel->view, (ButtonPanelModel * model) { - model->draw_callback = callback; - model->draw_context = context; - return true; - }); -} - -void button_panel_set_popup_input_callback( - ButtonPanel* button_panel, - ButtonPanelInputCallback callback, - void* context) { - button_panel->input_context = context; - button_panel->input_callback = callback; -} diff --git a/applications/gui/modules/button_panel.h b/applications/gui/modules/button_panel.h index 71ffdf3b..0c17e3a7 100644 --- a/applications/gui/modules/button_panel.h +++ b/applications/gui/modules/button_panel.h @@ -17,12 +17,6 @@ typedef struct ButtonPanel ButtonPanel; /** Callback type to call for handling selecting button_panel items */ typedef void (*ButtonItemCallback)(void* context, uint32_t index); -/** Callback type for additional drawings above main button_panel screen */ -typedef void (*ButtonPanelDrawCallback)(Canvas* canvas, void* _model); - -/** Callback type to intercept input events of button_panel */ -typedef bool (*ButtonPanelInputCallback)(InputEvent* event, void* context); - /** Allocate new button_panel module. * * @return ButtonPanel instance @@ -106,34 +100,6 @@ void button_panel_add_label( Font font, const char* label_str); -// TODO: [FL-1445] Have to replace callbacks above with additional popup-layer -/** Set popup draw callback for button_panel module. - * - * Used to add popup drawings after main draw callback is done. - * - * @param button_panel ButtonPanel instance - * @param callback callback function to set for draw event - * @param context context to pass to callback - */ -void button_panel_set_popup_draw_callback( - ButtonPanel* button_panel, - ButtonPanelDrawCallback callback, - void* context); - -/** Set popup input callback for button_panel module. - * - * Used to add popup input callback. It will intercept all input events for - * current view. - * - * @param button_panel ButtonPanel instance - * @param callback function to overwrite main input callbacks - * @param context context to pass to callback - */ -void button_panel_set_popup_input_callback( - ButtonPanel* button_panel, - ButtonPanelInputCallback callback, - void* context); - #ifdef __cplusplus } #endif diff --git a/applications/gui/modules/loading.c b/applications/gui/modules/loading.c new file mode 100644 index 00000000..7f623e24 --- /dev/null +++ b/applications/gui/modules/loading.c @@ -0,0 +1,94 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "loading.h" + +struct Loading { + View* view; +}; + +typedef struct { + IconAnimation* icon; +} LoadingModel; + +static void loading_draw_callback(Canvas* canvas, void* _model) { + LoadingModel* model = (LoadingModel*)_model; + + uint8_t x = 7; + uint8_t y = 40; + uint8_t width = 49; + uint8_t height = 47; + + elements_bold_rounded_frame(canvas, x, y, width, height); + + canvas_set_font(canvas, FontSecondary); + elements_multiline_text(canvas, x + 7, y + 13, "Loading..."); + + canvas_draw_icon_animation(canvas, x + 13, y + 19, model->icon); +} + +static bool loading_input_callback(InputEvent* event, void* context) { + furi_assert(context); + return true; +} + +static void loading_enter_callback(void* context) { + furi_assert(context); + Loading* instance = context; + LoadingModel* model = view_get_model(instance->view); + /* using Loading View in conjunction with several + * Stack View obligates to reassign + * Update callback, as it can be rewritten + */ + view_tie_icon_animation(instance->view, model->icon); + icon_animation_start(model->icon); + view_commit_model(instance->view, false); +} + +static void loading_exit_callback(void* context) { + furi_assert(context); + Loading* instance = context; + LoadingModel* model = view_get_model(instance->view); + icon_animation_stop(model->icon); + view_commit_model(instance->view, false); +} + +Loading* loading_alloc(void) { + Loading* instance = malloc(sizeof(Loading)); + instance->view = view_alloc(); + view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(LoadingModel)); + LoadingModel* model = view_get_model(instance->view); + model->icon = icon_animation_alloc(&A_Loading_24); + view_tie_icon_animation(instance->view, model->icon); + view_commit_model(instance->view, false); + + view_set_context(instance->view, instance); + view_set_draw_callback(instance->view, loading_draw_callback); + view_set_input_callback(instance->view, loading_input_callback); + view_set_enter_callback(instance->view, loading_enter_callback); + view_set_exit_callback(instance->view, loading_exit_callback); + + return instance; +} + +void loading_free(Loading* instance) { + LoadingModel* model = view_get_model(instance->view); + icon_animation_free(model->icon); + view_commit_model(instance->view, false); + + furi_assert(instance); + view_free(instance->view); + free(instance); +} + +View* loading_get_view(Loading* instance) { + furi_assert(instance); + furi_assert(instance->view); + return instance->view; +} diff --git a/applications/gui/modules/loading.h b/applications/gui/modules/loading.h new file mode 100644 index 00000000..1e071c10 --- /dev/null +++ b/applications/gui/modules/loading.h @@ -0,0 +1,35 @@ +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Loading anonymous structure */ +typedef struct Loading Loading; + +/** Allocate and initialize + * + * This View used to show system is doing some processing + * + * @return Loading View instance + */ +Loading* loading_alloc(); + +/** Deinitialize and free Loading View + * + * @param instance Loading instance + */ +void loading_free(Loading* instance); + +/** Get Loading view + * + * @param instance Loading instance + * + * @return View instance that can be used for embedding + */ +View* loading_get_view(Loading* instance); + +#ifdef __cplusplus +} +#endif diff --git a/applications/gui/view_stack.c b/applications/gui/view_stack.c index 715b5486..a1c96faa 100644 --- a/applications/gui/view_stack.c +++ b/applications/gui/view_stack.c @@ -33,7 +33,7 @@ static void view_stack_enter(void* context) { ViewStack* view_stack = context; ViewStackModel* model = view_get_model(view_stack->view); - /* if more than 1 composite views hold same view they have to reassign update_callback_context */ + /* if more than 1 Stack View hold same view they have to reassign update_callback_context */ for(int i = 0; i < MAX_VIEWS; ++i) { if(model->views[i]) { view_set_update_callback_context(model->views[i], view_stack->view); @@ -131,6 +131,9 @@ void view_stack_add_view(ViewStack* view_stack, View* view) { model->views[i] = view; view_set_update_callback(model->views[i], view_stack_update_callback); view_set_update_callback_context(model->views[i], view_stack->view); + if(view->enter_callback) { + view->enter_callback(view->context); + } result = true; break; } @@ -149,6 +152,9 @@ void view_stack_remove_view(ViewStack* view_stack, View* view) { ViewStackModel* model = view_get_model(view_stack->view); for(int i = 0; i < MAX_VIEWS; ++i) { if(model->views[i] == view) { + if(view->exit_callback) { + view->exit_callback(view->context); + } view_set_update_callback(model->views[i], NULL); view_set_update_callback_context(model->views[i], NULL); model->views[i] = NULL; diff --git a/applications/gui/view_stack.h b/applications/gui/view_stack.h index f733e6ad..cd62b4f6 100644 --- a/applications/gui/view_stack.h +++ b/applications/gui/view_stack.h @@ -13,6 +13,10 @@ #include #include "view.h" +#ifdef __cplusplus +extern "C" { +#endif + /** ViewStack, anonymous type. */ typedef struct ViewStack ViewStack; @@ -51,3 +55,7 @@ void view_stack_add_view(ViewStack* view_stack, View* view); * @view view view to remove */ void view_stack_remove_view(ViewStack* view_stack, View* view); + +#ifdef __cplusplus +} +#endif diff --git a/applications/irda/irda_app.h b/applications/irda/irda_app.h index 32ca3c2c..195aff34 100644 --- a/applications/irda/irda_app.h +++ b/applications/irda/irda_app.h @@ -3,7 +3,6 @@ #include #include #include "scene/irda_app_scene.h" -#include "irda_app_event.h" #include "scene/irda_app_scene.h" #include "irda_app_view_manager.h" #include "irda_app_remote_manager.h" @@ -11,6 +10,7 @@ #include #include #include +#include "irda_app_view_manager.h" class IrdaApp { public: diff --git a/applications/irda/irda_app_view_manager.cpp b/applications/irda/irda_app_view_manager.cpp index 46008bc0..841a3093 100644 --- a/applications/irda/irda_app_view_manager.cpp +++ b/applications/irda/irda_app_view_manager.cpp @@ -1,8 +1,13 @@ -#include +#include +#include +#include #include #include +#include #include +#include "irda/irda_app_view_manager.h" +#include "irda/view/irda_progress_view.h" #include "irda_app.h" #include "irda/irda_app_event.h" @@ -21,16 +26,20 @@ IrdaAppViewManager::IrdaAppViewManager() { dialog_ex = dialog_ex_alloc(); text_input = text_input_alloc(); button_panel = button_panel_alloc(); - popup_brut = popup_brut_alloc(); + progress_view = irda_progress_view_alloc(); + loading_view = loading_alloc(); + universal_view_stack = view_stack_alloc(); + view_stack_add_view(universal_view_stack, button_panel_get_view(button_panel)); + view_set_orientation(view_stack_get_view(universal_view_stack), ViewOrientationVertical); - add_view(ViewType::ButtonPanel, button_panel_get_view(button_panel)); + add_view(ViewType::UniversalRemote, view_stack_get_view(universal_view_stack)); add_view(ViewType::ButtonMenu, button_menu_get_view(button_menu)); add_view(ViewType::Submenu, submenu_get_view(submenu)); add_view(ViewType::Popup, popup_get_view(popup)); add_view(ViewType::DialogEx, dialog_ex_get_view(dialog_ex)); add_view(ViewType::TextInput, text_input_get_view(text_input)); - view_set_previous_callback(button_panel_get_view(button_panel), callback); + view_set_previous_callback(view_stack_get_view(universal_view_stack), callback); view_set_previous_callback(button_menu_get_view(button_menu), callback); view_set_previous_callback(submenu_get_view(submenu), callback); view_set_previous_callback(popup_get_view(popup), callback); @@ -40,7 +49,7 @@ IrdaAppViewManager::IrdaAppViewManager() { IrdaAppViewManager::~IrdaAppViewManager() { view_dispatcher_remove_view( - view_dispatcher, static_cast(IrdaAppViewManager::ViewType::ButtonPanel)); + view_dispatcher, static_cast(IrdaAppViewManager::ViewType::UniversalRemote)); view_dispatcher_remove_view( view_dispatcher, static_cast(IrdaAppViewManager::ViewType::ButtonMenu)); view_dispatcher_remove_view( @@ -52,13 +61,16 @@ IrdaAppViewManager::~IrdaAppViewManager() { view_dispatcher_remove_view( view_dispatcher, static_cast(IrdaAppViewManager::ViewType::Popup)); + view_stack_remove_view(universal_view_stack, button_panel_get_view(button_panel)); + view_stack_free(universal_view_stack); + button_panel_free(button_panel); submenu_free(submenu); popup_free(popup); - button_panel_free(button_panel); button_menu_free(button_menu); dialog_ex_free(dialog_ex); text_input_free(text_input); - popup_brut_free(popup_brut); + irda_progress_view_free(progress_view); + loading_free(loading_view); view_dispatcher_free(view_dispatcher); furi_record_close("gui"); @@ -93,8 +105,16 @@ ButtonPanel* IrdaAppViewManager::get_button_panel() { return button_panel; } -IrdaAppPopupBrut* IrdaAppViewManager::get_popup_brut() { - return popup_brut; +IrdaProgressView* IrdaAppViewManager::get_progress() { + return progress_view; +} + +Loading* IrdaAppViewManager::get_loading() { + return loading_view; +} + +ViewStack* IrdaAppViewManager::get_universal_view_stack() { + return universal_view_stack; } osMessageQueueId_t IrdaAppViewManager::get_event_queue() { @@ -126,7 +146,6 @@ void IrdaAppViewManager::send_event(IrdaAppEvent* event) { } osMessageQueuePut(event_queue, event, 0, timeout); - /* furi_check(result == osOK); */ } uint32_t IrdaAppViewManager::previous_view_callback(void* context) { diff --git a/applications/irda/irda_app_view_manager.h b/applications/irda/irda_app_view_manager.h index 565f8d00..358a3839 100644 --- a/applications/irda/irda_app_view_manager.h +++ b/applications/irda/irda_app_view_manager.h @@ -1,14 +1,17 @@ #pragma once -#include "gui/modules/button_menu.h" -#include "gui/modules/text_input.h" +#include +#include +#include +#include #include #include #include #include #include -#include "irda_app.h" -#include "view/irda_app_brut_view.h" -#include "gui/modules/button_panel.h" +#include + +#include "irda_app_event.h" +#include "view/irda_progress_view.h" class IrdaAppViewManager { public: @@ -17,7 +20,7 @@ public: TextInput, Submenu, ButtonMenu, - ButtonPanel, + UniversalRemote, Popup, }; @@ -36,7 +39,9 @@ public: TextInput* get_text_input(); ButtonMenu* get_button_menu(); ButtonPanel* get_button_panel(); - IrdaAppPopupBrut* get_popup_brut(); + ViewStack* get_universal_view_stack(); + IrdaProgressView* get_progress(); + Loading* get_loading(); osMessageQueueId_t get_event_queue(); @@ -51,7 +56,9 @@ private: Popup* popup; ButtonMenu* button_menu; ButtonPanel* button_panel; - IrdaAppPopupBrut* popup_brut; + ViewStack* universal_view_stack; + IrdaProgressView* progress_view; + Loading* loading_view; osMessageQueueId_t event_queue; diff --git a/applications/irda/scene/irda_app_scene_remote.cpp b/applications/irda/scene/irda_app_scene_remote.cpp index b8b0aa6c..5f928b41 100644 --- a/applications/irda/scene/irda_app_scene_remote.cpp +++ b/applications/irda/scene/irda_app_scene_remote.cpp @@ -1,8 +1,9 @@ -#include "../irda_app.h" -#include "gui/modules/button_menu.h" -#include "input/input.h" -#include "irda_worker.h" +#include +#include +#include #include +#include "../irda_app.h" +#include "../irda_app_view_manager.h" typedef enum { ButtonIndexPlus = -2, diff --git a/applications/irda/scene/irda_app_scene_universal_common.cpp b/applications/irda/scene/irda_app_scene_universal_common.cpp index 1b54791d..5a020ea7 100644 --- a/applications/irda/scene/irda_app_scene_universal_common.cpp +++ b/applications/irda/scene/irda_app_scene_universal_common.cpp @@ -1,13 +1,14 @@ -#include "../irda_app.h" -#include "assets_icons.h" #include -#include "gui/modules/button_menu.h" -#include "gui/modules/button_panel.h" -#include "../view/irda_app_brut_view.h" -#include "gui/view.h" +#include +#include +#include +#include + +#include "../irda_app.h" #include "irda/irda_app_event.h" #include "irda/irda_app_view_manager.h" #include "irda/scene/irda_app_scene.h" +#include "../view/irda_progress_view.h" void IrdaAppSceneUniversalCommon::irda_app_item_callback(void* context, uint32_t index) { IrdaApp* app = static_cast(context); @@ -19,42 +20,34 @@ void IrdaAppSceneUniversalCommon::irda_app_item_callback(void* context, uint32_t app->get_view_manager()->send_event(&event); } -static bool irda_popup_brut_input_callback(InputEvent* event, void* context) { +static void irda_progress_back_callback(void* context) { furi_assert(context); - furi_assert(event); auto app = static_cast(context); - bool consumed = false; - if((event->type == InputTypeShort) && (event->key == InputKeyBack)) { - consumed = true; - IrdaAppEvent irda_event; - - irda_event.type = IrdaAppEvent::Type::Back; - app->get_view_manager()->send_event(&irda_event); - } - - return consumed; + IrdaAppEvent irda_event = { + .type = IrdaAppEvent::Type::Back, + }; + app->get_view_manager()->clear_events(); + app->get_view_manager()->send_event(&irda_event); } void IrdaAppSceneUniversalCommon::remove_popup(IrdaApp* app) { - auto button_panel = app->get_view_manager()->get_button_panel(); - button_panel_set_popup_draw_callback(button_panel, NULL, NULL); - button_panel_set_popup_input_callback(button_panel, NULL, NULL); + auto stack_view = app->get_view_manager()->get_universal_view_stack(); + auto progress_view = app->get_view_manager()->get_progress(); + view_stack_remove_view(stack_view, irda_progress_view_get_view(progress_view)); } void IrdaAppSceneUniversalCommon::show_popup(IrdaApp* app, int record_amount) { - auto button_panel = app->get_view_manager()->get_button_panel(); - auto popup_brut = app->get_view_manager()->get_popup_brut(); - popup_brut_set_progress_max(popup_brut, record_amount); - button_panel_set_popup_draw_callback(button_panel, popup_brut_draw_callback, popup_brut); - button_panel_set_popup_input_callback(button_panel, irda_popup_brut_input_callback, app); + auto stack_view = app->get_view_manager()->get_universal_view_stack(); + auto progress_view = app->get_view_manager()->get_progress(); + irda_progress_view_set_progress_total(progress_view, record_amount); + irda_progress_view_set_back_callback(progress_view, irda_progress_back_callback, app); + view_stack_add_view(stack_view, irda_progress_view_get_view(progress_view)); } bool IrdaAppSceneUniversalCommon::progress_popup(IrdaApp* app) { - bool result = popup_brut_increase_progress(app->get_view_manager()->get_popup_brut()); - auto button_panel = app->get_view_manager()->get_button_panel(); - with_view_model_cpp(button_panel_get_view(button_panel), void*, model, { return true; }); - return result; + auto progress_view = app->get_view_manager()->get_progress(); + return irda_progress_view_increase_progress(progress_view); } bool IrdaAppSceneUniversalCommon::on_event(IrdaApp* app, IrdaAppEvent* event) { diff --git a/applications/irda/scene/irda_app_scene_universal_tv.cpp b/applications/irda/scene/irda_app_scene_universal_tv.cpp index 4bcf92d3..563d59df 100644 --- a/applications/irda/scene/irda_app_scene_universal_tv.cpp +++ b/applications/irda/scene/irda_app_scene_universal_tv.cpp @@ -1,3 +1,6 @@ +#include +#include +#include #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(); } } diff --git a/applications/irda/view/irda_app_brut_view.c b/applications/irda/view/irda_app_brut_view.c deleted file mode 100644 index 91429a35..00000000 --- a/applications/irda/view/irda_app_brut_view.c +++ /dev/null @@ -1,84 +0,0 @@ -#include "furi_hal_resources.h" -#include "assets_icons.h" -#include "gui/canvas.h" -#include "gui/view.h" -#include "input/input.h" -#include -#include -#include "irda_app_brut_view.h" -#include "gui/modules/button_panel.h" -#include - -struct IrdaAppPopupBrut { - uint16_t progress; - uint16_t progress_max; - char percents_string_storage[8]; -}; - -bool popup_brut_increase_progress(IrdaAppPopupBrut* popup_brut) { - furi_assert(popup_brut); - - if(popup_brut->progress < popup_brut->progress_max) - ++popup_brut->progress; - else - furi_assert(0); - - return popup_brut->progress < popup_brut->progress_max; -} - -void popup_brut_draw_callback(Canvas* canvas, void* context) { - furi_assert(canvas); - furi_assert(context); - IrdaAppPopupBrut* popup_brut = (IrdaAppPopupBrut*)context; - uint8_t x = 0; - uint8_t width = 64; - uint8_t x_max = x + width - 1; - uint8_t y = 36; - uint8_t height = 59; - uint8_t y_max = y + height - 1; - - canvas_invert_color(canvas); - canvas_draw_rbox(canvas, x + 1, y + 1, width - 2, height - 2, 3); - canvas_invert_color(canvas); - canvas_draw_rframe(canvas, x, y, width, height, 3); - canvas_draw_rframe(canvas, x + 1, y + 1, width - 2, height - 2, 3); - canvas_draw_line(canvas, x + 2, y + 1, x + 2, y + 3); - canvas_draw_line(canvas, x + 1, y + 2, x + 3, y + 2); - canvas_draw_line(canvas, x_max - 2, y + 1, x_max - 2, y + 3); - canvas_draw_line(canvas, x_max - 1, y + 2, x_max - 3, y + 2); - canvas_draw_line(canvas, x + 2, y_max - 1, x + 2, y_max - 3); - canvas_draw_line(canvas, x + 1, y_max - 2, x + 3, y_max - 2); - canvas_draw_line(canvas, x_max - 2, y_max - 1, x_max - 2, y_max - 3); - canvas_draw_line(canvas, x_max - 1, y_max - 2, x_max - 3, y_max - 2); - - elements_progress_bar( - canvas, x + 4, y + 19, x_max - 7, popup_brut->progress, popup_brut->progress_max); - - canvas_set_font(canvas, FontSecondary); - canvas_draw_str(canvas, x + 15, y + 12, "Sending ..."); - canvas_draw_icon(canvas, x + 11, y_max - 14, &I_Back_15x10); - - uint8_t percent_value = 100 * popup_brut->progress / popup_brut->progress_max; - snprintf( - popup_brut->percents_string_storage, - sizeof(popup_brut->percents_string_storage), - "%d%%", - percent_value); - elements_multiline_text_aligned( - canvas, x + 32, y + 40, AlignCenter, AlignBottom, popup_brut->percents_string_storage); - canvas_draw_str(canvas, x + 30, y_max - 5, "= stop"); -} - -void popup_brut_set_progress_max(IrdaAppPopupBrut* popup_brut, uint16_t progress_max) { - furi_assert(popup_brut); - popup_brut->progress = 0; - popup_brut->progress_max = progress_max; -} - -IrdaAppPopupBrut* popup_brut_alloc(void) { - return (IrdaAppPopupBrut*)malloc(sizeof(IrdaAppPopupBrut)); -} - -void popup_brut_free(IrdaAppPopupBrut* popup_brut) { - free(popup_brut); -} diff --git a/applications/irda/view/irda_app_brut_view.h b/applications/irda/view/irda_app_brut_view.h deleted file mode 100644 index 3f6b973a..00000000 --- a/applications/irda/view/irda_app_brut_view.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct IrdaAppPopupBrut IrdaAppPopupBrut; - -bool popup_brut_increase_progress(IrdaAppPopupBrut* popup_brut); -IrdaAppPopupBrut* popup_brut_alloc(); -void popup_brut_free(IrdaAppPopupBrut* popup_brut); -void popup_brut_draw_callback(Canvas* canvas, void* model); -void popup_brut_set_progress_max(IrdaAppPopupBrut* popup_brut, uint16_t progress_max); - -#ifdef __cplusplus -} -#endif diff --git a/applications/irda/view/irda_progress_view.c b/applications/irda/view/irda_progress_view.c new file mode 100644 index 00000000..4a914a17 --- /dev/null +++ b/applications/irda/view/irda_progress_view.c @@ -0,0 +1,119 @@ +#include "furi/check.h" +#include "furi_hal_resources.h" +#include "assets_icons.h" +#include "gui/canvas.h" +#include "gui/view.h" +#include "input/input.h" +#include "m-string.h" +#include +#include +#include "irda_progress_view.h" +#include "gui/modules/button_panel.h" +#include + +struct IrdaProgressView { + View* view; + IrdaProgressViewBackCallback back_callback; + void* context; +}; + +typedef struct { + size_t progress; + size_t progress_total; +} IrdaProgressViewModel; + +bool irda_progress_view_increase_progress(IrdaProgressView* progress) { + furi_assert(progress); + bool result = false; + + IrdaProgressViewModel* model = view_get_model(progress->view); + if(model->progress < model->progress_total) { + ++model->progress; + result = model->progress < model->progress_total; + } + view_commit_model(progress->view, true); + + return result; +} + +static void irda_progress_view_draw_callback(Canvas* canvas, void* _model) { + IrdaProgressViewModel* model = (IrdaProgressViewModel*)_model; + + uint8_t x = 0; + uint8_t y = 36; + uint8_t width = 63; + uint8_t height = 59; + + elements_bold_rounded_frame(canvas, x, y, width, height); + + canvas_set_font(canvas, FontSecondary); + elements_multiline_text_aligned( + canvas, x + 34, y + 9, AlignCenter, AlignCenter, "Sending ..."); + + float progress_value = (float)model->progress / model->progress_total; + elements_progress_bar(canvas, x + 4, y + 19, width - 7, progress_value); + + uint8_t percent_value = 100 * model->progress / model->progress_total; + char percents_string[10] = {0}; + snprintf(percents_string, sizeof(percents_string), "%d%%", percent_value); + elements_multiline_text_aligned( + canvas, x + 33, y + 37, AlignCenter, AlignCenter, percents_string); + + canvas_draw_icon(canvas, x + 11, y + height - 15, &I_Back_15x10); + canvas_draw_str(canvas, x + 30, y + height - 6, "= stop"); +} + +void irda_progress_view_set_progress_total(IrdaProgressView* progress, uint16_t progress_total) { + furi_assert(progress); + IrdaProgressViewModel* model = view_get_model(progress->view); + model->progress = 0; + model->progress_total = progress_total; + view_commit_model(progress->view, false); +} + +bool irda_progress_view_input_callback(InputEvent* event, void* context) { + IrdaProgressView* instance = context; + + if((event->type == InputTypeShort) && (event->key == InputKeyBack)) { + if(instance->back_callback) { + instance->back_callback(instance->context); + } + } + + return true; +} + +IrdaProgressView* irda_progress_view_alloc(void) { + IrdaProgressView* instance = malloc(sizeof(IrdaProgressView)); + instance->view = view_alloc(); + view_allocate_model(instance->view, ViewModelTypeLocking, sizeof(IrdaProgressViewModel)); + IrdaProgressViewModel* model = view_get_model(instance->view); + model->progress = 0; + model->progress_total = 0; + view_commit_model(instance->view, false); + view_set_draw_callback(instance->view, irda_progress_view_draw_callback); + view_set_input_callback(instance->view, irda_progress_view_input_callback); + view_set_context(instance->view, instance); + + return instance; +} + +void irda_progress_view_free(IrdaProgressView* progress) { + view_free(progress->view); + free(progress); +} + +void irda_progress_view_set_back_callback( + IrdaProgressView* instance, + IrdaProgressViewBackCallback callback, + void* context) { + furi_assert(instance); + instance->back_callback = callback; + instance->context = context; +} + +View* irda_progress_view_get_view(IrdaProgressView* instance) { + furi_assert(instance); + furi_assert(instance->view); + return instance->view; +} diff --git a/applications/irda/view/irda_progress_view.h b/applications/irda/view/irda_progress_view.h new file mode 100644 index 00000000..f0e41928 --- /dev/null +++ b/applications/irda/view/irda_progress_view.h @@ -0,0 +1,25 @@ +#pragma once +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct IrdaProgressView IrdaProgressView; + +typedef void (*IrdaProgressViewBackCallback)(void*); + +IrdaProgressView* irda_progress_view_alloc(); +void irda_progress_view_free(IrdaProgressView* progress); +View* irda_progress_view_get_view(IrdaProgressView* progress); + +bool irda_progress_view_increase_progress(IrdaProgressView* progress); +void irda_progress_view_set_progress_total(IrdaProgressView* progress, uint16_t progress_max); +void irda_progress_view_set_back_callback( + IrdaProgressView* instance, + IrdaProgressViewBackCallback callback, + void* context); + +#ifdef __cplusplus +} +#endif diff --git a/assets/compiled/assets_icons.c b/assets/compiled/assets_icons.c index 4562a603..aa2f26cf 100644 --- a/assets/compiled/assets_icons.c +++ b/assets/compiled/assets_icons.c @@ -148,6 +148,15 @@ const uint8_t* const _I_DFU_128x50[] = {_I_DFU_128x50_0}; const uint8_t _I_Warning_30x23_0[] = {0x01,0x00,0x47,0x00,0x80,0x70,0x00,0x65,0xe0,0x80,0x80,0xc7,0xe1,0x03,0x01,0xaf,0xe2,0x0e,0x03,0x19,0xe4,0x3c,0x06,0xb3,0xe8,0xf8,0x0c,0x67,0xf3,0xf0,0x1a,0x60,0x27,0xf7,0xf1,0x50,0xcf,0xff,0xe0,0x34,0xf0,0x00,0xc6,0x03,0xf0,0x01,0x8c,0x0c,0x06,0x7f,0x80,0x18,0xc1,0xff,0x9f,0xff,0xfc,0x3c,0x06,0x7f,0xe0,0x58,0xc7,0xff,0xe0,0x31,0x00,0x88,0x00,0x67,0xff,0xe0,0x18,0xc7,0xc0,}; const uint8_t* const _I_Warning_30x23[] = {_I_Warning_30x23_0}; +const uint8_t _A_Loading_24_0[] = {0x01,0x00,0x37,0x00,0x00,0x17,0x83,0xff,0x0f,0x90,0x40,0x21,0x1c,0x0f,0xfc,0x1f,0x01,0x00,0x81,0x60,0x35,0x40,0x21,0xaa,0x00,0x86,0x51,0x02,0x80,0x44,0x60,0x30,0x0c,0x10,0x6c,0x6a,0x80,0x21,0x94,0x00,0x92,0x88,0x02,0x1c,0x90,0x08,0x60,0x30,0x11,0x19,0x80,0x9c,0x64,0x43,0x82,0x1f,0x11,0x10,0x80,}; +const uint8_t _A_Loading_24_1[] = {0x01,0x00,0x38,0x00,0x00,0x17,0x83,0xff,0x0f,0x90,0x40,0x21,0x1c,0x0f,0xfc,0x1f,0x01,0x00,0x81,0x00,0x8e,0xa8,0x02,0x19,0x44,0x0a,0x01,0x11,0x80,0xc0,0x30,0x41,0xb1,0xa2,0x00,0x86,0x50,0x02,0x40,0x41,0x64,0x80,0x43,0x01,0x80,0xe0,0x22,0x02,0x34,0x01,0x16,0xaa,0x04,0x32,0x21,0xc1,0x0f,0x88,0x88,0x40,}; +const uint8_t _A_Loading_24_2[] = {0x01,0x00,0x36,0x00,0x00,0x17,0x83,0xff,0x0f,0x90,0x40,0x21,0x1c,0x0f,0xfc,0x1f,0x01,0x00,0x81,0x00,0x9a,0x51,0x02,0x80,0x44,0x60,0x30,0x0c,0x10,0x6c,0x68,0x80,0x21,0x94,0x00,0x92,0xa8,0x02,0x10,0x71,0x05,0x04,0x3a,0x70,0x80,0x10,0xd5,0x00,0x43,0xaa,0x81,0x0c,0x88,0x70,0x43,0xe2,0x22,0x10,}; +const uint8_t _A_Loading_24_3[] = {0x01,0x00,0x33,0x00,0x00,0x17,0x83,0xff,0x0f,0x90,0x40,0x21,0x1c,0x0f,0xfc,0x1f,0x01,0x00,0x81,0x00,0xa2,0x01,0x01,0x80,0xc0,0x30,0x41,0xb1,0xa2,0x00,0x86,0x50,0x02,0x40,0x41,0x64,0x80,0x43,0x29,0x80,0xe0,0x2a,0x81,0xd1,0xd5,0x00,0x84,0x0a,0x83,0x22,0x1c,0x10,0xf8,0x88,0x84,}; +const uint8_t _A_Loading_24_4[] = {0x01,0x00,0x42,0x00,0x80,0x40,0x80,0x43,0x07,0x80,0x60,0x00,0xa3,0x40,0x82,0xc0,0x34,0x10,0x88,0x05,0x42,0x21,0x00,0x94,0x00,0x86,0x28,0x02,0x18,0x50,0x08,0x60,0xe0,0x54,0x88,0x78,0x20,0xe0,0x11,0x0c,0x0c,0xa2,0xa1,0x00,0xa4,0x79,0x60,0x1a,0x8a,0x90,0x14,0x65,0x20,0x51,0x8a,0x01,0x46,0x14,0x18,0x11,0x81,0x0d,0x8a,0x03,0x00,0xf0,0x10,0x46,0x81,0x00,}; +const uint8_t _A_Loading_24_5[] = {0x01,0x00,0x2d,0x00,0x00,0x74,0x1a,0x01,0x60,0x85,0x40,0x2a,0x1f,0xa8,0x05,0x7e,0x15,0x81,0xa8,0x42,0xa8,0x40,0x21,0x92,0x00,0x86,0x31,0x5a,0x85,0x50,0x2a,0xb0,0xac,0xc0,0x14,0x64,0x80,0x51,0xa1,0x01,0x44,0x2e,0x21,0xd3,0x11,0x88,0xa4,0x87,0x16,}; +const uint8_t _A_Loading_24_6[] = {0x01,0x00,0x43,0x00,0x80,0x50,0x00,0x43,0xe0,0x02,0x94,0x06,0x01,0xa0,0x81,0x40,0x22,0x10,0x58,0x04,0x22,0x14,0x02,0x18,0xa4,0x02,0x91,0x29,0x80,0x6a,0x2a,0x40,0x51,0xf2,0x81,0x4b,0xc1,0x07,0x84,0x44,0x00,0x63,0x0a,0x88,0x40,0x20,0xe0,0x21,0x02,0x94,0x50,0x04,0x32,0x80,0x10,0xd4,0x00,0x43,0xa0,0x84,0x0d,0x04,0x5c,0x38,0x01,0xa0,0x86,0x04,0x04,0x20,0x51,}; +const uint8_t* const _A_Loading_24[] = {_A_Loading_24_0,_A_Loading_24_1,_A_Loading_24_2,_A_Loading_24_3,_A_Loading_24_4,_A_Loading_24_5,_A_Loading_24_6}; + const uint8_t _I_DolphinFirstStart0_70x53_0[] = {0x01,0x00,0x5a,0x01,0x80,0x60,0x3f,0xf7,0xf0,0x42,0xf8,0x01,0x43,0x07,0x04,0x24,0x72,0x01,0xc0,0x9d,0x82,0x13,0xff,0xff,0xbd,0x70,0x20,0x20,0x72,0xe0,0x40,0x2a,0x11,0xdb,0x00,0x6c,0xec,0x10,0x0d,0x44,0x3a,0x71,0x0e,0x04,0x14,0x42,0x01,0x54,0x86,0xd3,0x27,0x02,0x44,0xd4,0x41,0xb0,0xf2,0x10,0x42,0x55,0x38,0x71,0x1b,0x10,0x18,0xa0,0x41,0x11,0xb1,0xc8,0x28,0x98,0x09,0xfc,0x00,0x72,0x35,0x49,0x8d,0x0b,0xc1,0x70,0xf0,0x10,0x4b,0x51,0x11,0xc2,0x6c,0x0a,0xa3,0x03,0x80,0x7f,0xbf,0xf3,0x08,0x46,0x60,0x90,0x30,0x60,0x50,0xd8,0x2c,0x11,0x0c,0x71,0x5c,0x60,0xf8,0x0f,0xcf,0x3f,0x81,0x80,0xa1,0x9e,0x86,0x0f,0xc0,0x82,0x64,0x30,0x3e,0x09,0x84,0x03,0xf1,0x03,0xa0,0x40,0xa4,0x18,0x39,0xfc,0x20,0x52,0x30,0x19,0x07,0xc6,0x8e,0x4a,0x18,0x22,0x74,0x60,0x1a,0x0f,0xc6,0x3c,0x60,0x5c,0x05,0x28,0xe4,0x3f,0x99,0xf8,0x22,0x28,0x7e,0x05,0x91,0xa8,0x7f,0x23,0xf0,0x59,0x00,0xac,0x63,0xe0,0x81,0xcf,0x4f,0xe0,0xb1,0x81,0x58,0xc3,0xc1,0x08,0x24,0x1f,0xf9,0x68,0x6a,0x1f,0xe9,0xff,0x16,0x02,0x34,0x13,0x50,0x82,0x0a,0xea,0x60,0x1f,0xf9,0xf0,0x41,0x05,0x1d,0x30,0x09,0x18,0x60,0x15,0xa3,0xe8,0x83,0x47,0xe0,0xec,0x2c,0xaf,0xf2,0x0e,0x08,0x1f,0xc1,0x18,0x60,0x1a,0xaf,0xc2,0x6c,0x89,0x62,0x03,0x19,0xad,0xe5,0x70,0x44,0x62,0x80,0x5a,0xa1,0x4f,0x63,0x23,0x0c,0x7a,0xaa,0x4d,0x11,0xe9,0x00,0x06,0x73,0xaa,0x25,0x0a,0x78,0xaf,0x90,0x09,0x25,0x54,0x56,0x5f,0x04,0x30,0xc0,0x64,0x7a,0xa1,0x11,0x7e,0x20,0x18,0x0f,0x3c,0x82,0xaa,0x04,0x18,0x0d,0xf8,0x16,0x33,0xe8,0x84,0xa8,0x08,0x3c,0x33,0x00,0xf0,0x20,0x71,0x08,0xa9,0x38,0x86,0x62,0x62,0x18,0x40,0x44,0x80,0x09,0x04,0x08,0x90,0x01,0x20,0x41,0x17,0x22,0x90,0x01,0x3e,0x00,0x76,0x80,0x1d,0x48,0x00,0x8d,0x91,0x00,0x34,0xf8,0x20,0xe2,0xa7,0x9c,0x06,0x5c,0x11,0x02,0x28,0x5d,0x91,0x35,0x48,0xaf,0xf8,0x04,0x3f,0xf9,0x88,0x20,0x01,}; const uint8_t* const _I_DolphinFirstStart0_70x53[] = {_I_DolphinFirstStart0_70x53_0}; @@ -693,6 +702,7 @@ const Icon I_ButtonRight_4x7 = {.width=4,.height=7,.frame_count=1,.frame_rate=0, const Icon I_ButtonUp_7x4 = {.width=7,.height=4,.frame_count=1,.frame_rate=0,.frames=_I_ButtonUp_7x4}; const Icon I_DFU_128x50 = {.width=128,.height=50,.frame_count=1,.frame_rate=0,.frames=_I_DFU_128x50}; const Icon I_Warning_30x23 = {.width=30,.height=23,.frame_count=1,.frame_rate=0,.frames=_I_Warning_30x23}; +const Icon A_Loading_24 = {.width=24,.height=24,.frame_count=7,.frame_rate=5,.frames=_A_Loading_24}; const Icon I_DolphinFirstStart0_70x53 = {.width=70,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart0_70x53}; const Icon I_DolphinFirstStart1_59x53 = {.width=59,.height=53,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart1_59x53}; const Icon I_DolphinFirstStart2_59x51 = {.width=59,.height=51,.frame_count=1,.frame_rate=0,.frames=_I_DolphinFirstStart2_59x51}; diff --git a/assets/compiled/assets_icons.h b/assets/compiled/assets_icons.h index 26e26bef..7c964e1c 100644 --- a/assets/compiled/assets_icons.h +++ b/assets/compiled/assets_icons.h @@ -43,6 +43,7 @@ extern const Icon I_ButtonRight_4x7; extern const Icon I_ButtonUp_7x4; extern const Icon I_DFU_128x50; extern const Icon I_Warning_30x23; +extern const Icon A_Loading_24; extern const Icon I_DolphinFirstStart0_70x53; extern const Icon I_DolphinFirstStart1_59x53; extern const Icon I_DolphinFirstStart2_59x51; diff --git a/assets/icons/Common/Loading_24/frame_01.png b/assets/icons/Common/Loading_24/frame_01.png new file mode 100644 index 00000000..438f971f Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_01.png differ diff --git a/assets/icons/Common/Loading_24/frame_02.png b/assets/icons/Common/Loading_24/frame_02.png new file mode 100644 index 00000000..3455cd40 Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_02.png differ diff --git a/assets/icons/Common/Loading_24/frame_03.png b/assets/icons/Common/Loading_24/frame_03.png new file mode 100644 index 00000000..76d48a4d Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_03.png differ diff --git a/assets/icons/Common/Loading_24/frame_04.png b/assets/icons/Common/Loading_24/frame_04.png new file mode 100644 index 00000000..12d127e0 Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_04.png differ diff --git a/assets/icons/Common/Loading_24/frame_05.png b/assets/icons/Common/Loading_24/frame_05.png new file mode 100644 index 00000000..bfab3eca Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_05.png differ diff --git a/assets/icons/Common/Loading_24/frame_06.png b/assets/icons/Common/Loading_24/frame_06.png new file mode 100644 index 00000000..a876adc5 Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_06.png differ diff --git a/assets/icons/Common/Loading_24/frame_07.png b/assets/icons/Common/Loading_24/frame_07.png new file mode 100644 index 00000000..04049ebd Binary files /dev/null and b/assets/icons/Common/Loading_24/frame_07.png differ diff --git a/assets/icons/Common/Loading_24/frame_rate b/assets/icons/Common/Loading_24/frame_rate new file mode 100644 index 00000000..7ed6ff82 --- /dev/null +++ b/assets/icons/Common/Loading_24/frame_rate @@ -0,0 +1 @@ +5 diff --git a/firmware/targets/f6/Inc/FreeRTOSConfig.h b/firmware/targets/f6/Inc/FreeRTOSConfig.h index 1128f084..2f7b1df4 100644 --- a/firmware/targets/f6/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f6/Inc/FreeRTOSConfig.h @@ -59,6 +59,7 @@ extern uint32_t SystemCoreClock; /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ +#define INCLUDE_xTaskGetHandle 1 #define INCLUDE_eTaskGetState 1 #define INCLUDE_uxTaskGetStackHighWaterMark 1 #define INCLUDE_uxTaskPriorityGet 1 diff --git a/firmware/targets/f6/target.mk b/firmware/targets/f6/target.mk index 767cbfa0..cd2bf612 100644 --- a/firmware/targets/f6/target.mk +++ b/firmware/targets/f6/target.mk @@ -63,7 +63,6 @@ C_SOURCES += \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c \ - $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_adc.c \ diff --git a/firmware/targets/f7/Inc/FreeRTOSConfig.h b/firmware/targets/f7/Inc/FreeRTOSConfig.h index 1128f084..2f7b1df4 100644 --- a/firmware/targets/f7/Inc/FreeRTOSConfig.h +++ b/firmware/targets/f7/Inc/FreeRTOSConfig.h @@ -59,6 +59,7 @@ extern uint32_t SystemCoreClock; /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ +#define INCLUDE_xTaskGetHandle 1 #define INCLUDE_eTaskGetState 1 #define INCLUDE_uxTaskGetStackHighWaterMark 1 #define INCLUDE_uxTaskPriorityGet 1 diff --git a/firmware/targets/f7/target.mk b/firmware/targets/f7/target.mk index 767cbfa0..cd2bf612 100644 --- a/firmware/targets/f7/target.mk +++ b/firmware/targets/f7/target.mk @@ -63,7 +63,6 @@ C_SOURCES += \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_pwr_ex.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rcc.c \ - $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_rtc_ex.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_hal_tim_ex.c \ $(CUBE_DIR)/Drivers/STM32WBxx_HAL_Driver/Src/stm32wbxx_ll_adc.c \