Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
#include "menu.h"
|
|
|
|
#include <cmsis_os.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
|
|
#include <flipper.h>
|
2020-10-15 15:56:47 +00:00
|
|
|
#include <flipper_v2.h>
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
#include <gui/gui.h>
|
|
|
|
|
|
|
|
#include "menu_event.h"
|
|
|
|
#include "menu_item.h"
|
|
|
|
|
|
|
|
struct Menu {
|
|
|
|
MenuEvent* event;
|
2020-10-15 15:56:47 +00:00
|
|
|
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
// GUI
|
|
|
|
Widget* widget;
|
2020-10-15 15:56:47 +00:00
|
|
|
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
// State
|
|
|
|
MenuItem* root;
|
|
|
|
MenuItem* settings;
|
|
|
|
MenuItem* current;
|
|
|
|
uint32_t position;
|
|
|
|
};
|
|
|
|
|
2020-10-15 15:56:47 +00:00
|
|
|
void menu_widget_callback(CanvasApi* canvas, void* context);
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
|
2020-10-15 15:56:47 +00:00
|
|
|
Menu* menu_init() {
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
Menu* menu = furi_alloc(sizeof(Menu));
|
|
|
|
|
|
|
|
// Event dispatcher
|
|
|
|
menu->event = menu_event_alloc();
|
|
|
|
|
|
|
|
// Allocate and configure widget
|
|
|
|
menu->widget = widget_alloc();
|
|
|
|
widget_draw_callback_set(menu->widget, menu_widget_callback, menu);
|
|
|
|
widget_input_callback_set(menu->widget, menu_event_input_callback, menu->event);
|
|
|
|
|
|
|
|
// Open GUI and register fullscreen widget
|
2020-10-15 15:56:47 +00:00
|
|
|
GuiApi* gui = furi_open("gui");
|
|
|
|
assert(gui);
|
|
|
|
gui->add_widget(gui, menu->widget, WidgetLayerFullscreen);
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
|
|
|
|
return menu;
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_build_main(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
// Root point
|
|
|
|
menu->root = menu_item_alloc_menu(NULL, NULL);
|
|
|
|
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("Sub 1 gHz", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("125 kHz RFID", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("Infrared", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("I-Button", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("USB", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("Bluetooth", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("GPIO / HW", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("NFC", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("U2F", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("Tamagotchi", NULL, NULL));
|
|
|
|
menu_item_add(menu, menu_item_alloc_function("Plugins", NULL, NULL));
|
|
|
|
|
|
|
|
menu->settings = menu_item_alloc_menu("Setting", NULL);
|
|
|
|
menu_item_subitem_add(menu->settings, menu_item_alloc_function("one", NULL, NULL));
|
|
|
|
menu_item_subitem_add(menu->settings, menu_item_alloc_function("two", NULL, NULL));
|
|
|
|
menu_item_subitem_add(menu->settings, menu_item_alloc_function("three", NULL, NULL));
|
|
|
|
|
|
|
|
menu_item_add(menu, menu->settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_item_add(Menu* menu, MenuItem* item) {
|
|
|
|
menu_item_subitem_add(menu->root, item);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_settings_item_add(Menu* menu, MenuItem* item) {
|
|
|
|
menu_item_subitem_add(menu->settings, item);
|
|
|
|
}
|
|
|
|
|
2020-10-15 15:56:47 +00:00
|
|
|
void menu_widget_callback(CanvasApi* canvas, void* context) {
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
assert(canvas);
|
|
|
|
assert(context);
|
|
|
|
|
|
|
|
Menu* menu = context;
|
|
|
|
|
|
|
|
menu_event_lock(menu->event);
|
|
|
|
|
|
|
|
if(!menu->current) {
|
2020-10-15 15:56:47 +00:00
|
|
|
canvas->clear(canvas);
|
|
|
|
canvas->set_color(canvas, ColorBlack);
|
|
|
|
canvas->set_font(canvas, canvas->fonts->primary);
|
|
|
|
canvas->draw_str(canvas, 2, 32, "Idle Screen");
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
} else {
|
|
|
|
MenuItemArray_t* items = menu_item_get_subitems(menu->current);
|
2020-10-15 15:56:47 +00:00
|
|
|
canvas->clear(canvas);
|
|
|
|
canvas->set_color(canvas, ColorBlack);
|
|
|
|
canvas->set_font(canvas, canvas->fonts->secondary);
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
for(size_t i = 0; i < 5; i++) {
|
|
|
|
size_t shift_position = i + menu->position + MenuItemArray_size(*items) - 2;
|
|
|
|
shift_position = shift_position % (MenuItemArray_size(*items));
|
|
|
|
MenuItem* item = *MenuItemArray_get(*items, shift_position);
|
2020-10-15 15:56:47 +00:00
|
|
|
canvas->draw_str(canvas, 2, 12 * (i + 1), menu_item_get_label(item));
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
menu_event_unlock(menu->event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_update(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
|
|
|
|
menu_event_activity_notify(menu->event);
|
|
|
|
widget_update(menu->widget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_up(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
|
|
|
|
MenuItemArray_t* items = menu_item_get_subitems(menu->current);
|
|
|
|
if(menu->position == 0) menu->position = MenuItemArray_size(*items);
|
|
|
|
menu->position--;
|
|
|
|
menu_update(menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_down(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
|
|
|
|
MenuItemArray_t* items = menu_item_get_subitems(menu->current);
|
|
|
|
menu->position++;
|
|
|
|
menu->position = menu->position % MenuItemArray_size(*items);
|
|
|
|
menu_update(menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_ok(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
|
|
|
|
if(!menu->current) {
|
|
|
|
menu->current = menu->root;
|
|
|
|
menu_update(menu);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItemArray_t* items = menu_item_get_subitems(menu->current);
|
|
|
|
MenuItem* item = *MenuItemArray_get(*items, menu->position);
|
|
|
|
MenuItemType type = menu_item_get_type(item);
|
|
|
|
|
|
|
|
if(type == MenuItemTypeMenu) {
|
|
|
|
menu->current = item;
|
|
|
|
menu->position = 0;
|
|
|
|
menu_update(menu);
|
|
|
|
} else if(type == MenuItemTypeFunction) {
|
|
|
|
MenuItemCallback function = menu_item_get_function(item);
|
|
|
|
if(function) function();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_back(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
MenuItem* parent = menu_item_get_parent(menu->current);
|
|
|
|
if(parent) {
|
|
|
|
menu->current = parent;
|
|
|
|
menu->position = 0;
|
|
|
|
menu_update(menu);
|
|
|
|
} else {
|
|
|
|
menu_exit(menu);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_exit(Menu* menu) {
|
|
|
|
assert(menu);
|
|
|
|
menu->position = 0;
|
|
|
|
menu->current = NULL;
|
|
|
|
menu_update(menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
void menu_task(void* p) {
|
2020-10-15 15:56:47 +00:00
|
|
|
Menu* menu = menu_init();
|
|
|
|
menu_build_main(menu);
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
|
|
|
|
if(!furi_create_deprecated("menu", menu, sizeof(menu))) {
|
|
|
|
printf("[menu_task] cannot create the menu record\n");
|
|
|
|
furiac_exit(NULL);
|
|
|
|
}
|
2020-10-15 15:56:47 +00:00
|
|
|
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
furiac_ready();
|
2020-10-15 07:38:20 +00:00
|
|
|
|
Display and UI implementation (#169)
* Menu app. Lib: add mlib submodule.
* Menu: new startup lib dependency definition
* Menu: hierarchy in menu. Cube: fix heap1/4 inconsistency, stack protection.
* GUI: rendering pipeline initial version.
* GUI: layered widget composing, FURI record. Menu: FURI record, api.
* GUI: input dispatching. Menu: switch to input from GUI.
* GUI, MENU: code style cleanup, fix type conversion warnings.
* GUI, Menu: syntax check.
* Makefile: check and reinit submodules, format.
* Menu: lock on event processing. Makefile: proper submodule initialization.
* Menu: fix stack corruption by queue.
* GUI: refactor.
* Makefile: format rule fix, st-util pid.
* GUI, Menu, FURI: format with clang-format.
* GUI, MENU: locks in critical sections, fix stack corruption, ready signaling.
* Makefile: clang format rule cleanup.
* GUI,MENU: migrate to new API.
* Applications: PRODUCTION_HW variable, skip drivers build on local target.
* refactor production build
* add git to dockerfile
* GUI: uncomment lock block
Co-authored-by: Aleksandr Kutuzov <aku@plooks.com>
2020-10-14 10:21:55 +00:00
|
|
|
while(1) {
|
|
|
|
MenuMessage m = menu_event_next(menu->event);
|
|
|
|
|
|
|
|
if(!menu->current && m.type != MenuMessageTypeOk) {
|
|
|
|
continue;
|
|
|
|
} else if(m.type == MenuMessageTypeUp) {
|
|
|
|
menu_up(menu);
|
|
|
|
} else if(m.type == MenuMessageTypeDown) {
|
|
|
|
menu_down(menu);
|
|
|
|
} else if(m.type == MenuMessageTypeOk) {
|
|
|
|
menu_ok(menu);
|
|
|
|
} else if(m.type == MenuMessageTypeLeft) {
|
|
|
|
menu_back(menu);
|
|
|
|
} else if(m.type == MenuMessageTypeRight) {
|
|
|
|
menu_ok(menu);
|
|
|
|
} else if(m.type == MenuMessageTypeBack) {
|
|
|
|
menu_back(menu);
|
|
|
|
} else if(m.type == MenuMessageTypeIdle) {
|
|
|
|
menu_exit(menu);
|
|
|
|
} else {
|
|
|
|
// TODO: fail somehow?
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|