diff --git a/README.md b/README.md index a8fb840b..7d165b26 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,9 @@ UI is created with [lvgl](https://github.com/lvgl/lvgl) via [esp_lvgl_port](http ## Supported Hardware +**NOTE**: `sdkconfig.defaults` currently contains `CONFIG_LV_COLOR_16_SWAP=y`. +You might have to remove this setting if you're not using the Yellow Board described below. + ### Devices See below for the supported hardware. diff --git a/components/nanobake/src/applications/services/desktop/desktop.c b/components/nanobake/src/applications/services/desktop/desktop.c index 1500b6c3..ecd958a9 100644 --- a/components/nanobake/src/applications/services/desktop/desktop.c +++ b/components/nanobake/src/applications/services/desktop/desktop.c @@ -2,6 +2,7 @@ #include "nb_hardware.h" #include "core_defines.h" +#include "esp_log.h" static int32_t prv_desktop_main(void* param) { UNUSED(param); printf("desktop app init\n"); @@ -13,6 +14,6 @@ const NbApp desktop_app = { .name = "Desktop", .type = SERVICE, .entry_point = &prv_desktop_main, - .stack_size = 2048, - .priority = 10 + .stack_size = NB_TASK_STACK_SIZE_DEFAULT, + .priority = NB_TASK_PRIORITY_DEFAULT }; diff --git a/components/nanobake/src/applications/services/gui/gui.c b/components/nanobake/src/applications/services/gui/gui.c index 523702a7..81bf9ded 100644 --- a/components/nanobake/src/applications/services/gui/gui.c +++ b/components/nanobake/src/applications/services/gui/gui.c @@ -3,7 +3,7 @@ #include "record.h" #include "check.h" -#define TAG "Gui" +#define TAG "gui" // Forward declarations from gui_draw.c bool gui_redraw_fs(NbGui* gui); @@ -233,6 +233,6 @@ const NbApp gui_app = { .name = "GUI", .type = SERVICE, .entry_point = &prv_gui_main, - .stack_size = 2048, - .priority = 10 + .stack_size = NB_TASK_STACK_SIZE_DEFAULT, + .priority = NB_TASK_PRIORITY_DEFAULT }; diff --git a/components/nanobake/src/applications/services/loader/loader.c b/components/nanobake/src/applications/services/loader/loader.c index c7507d4e..153a71e4 100644 --- a/components/nanobake/src/applications/services/loader/loader.c +++ b/components/nanobake/src/applications/services/loader/loader.c @@ -12,6 +12,6 @@ const NbApp loader_app = { .name = "Loader", .type = SERVICE, .entry_point = &prv_loader_main, - .stack_size = 2048, - .priority = 10 + .stack_size = NB_TASK_STACK_SIZE_DEFAULT, + .priority = NB_TASK_PRIORITY_DEFAULT }; diff --git a/components/nanobake/src/applications/system/system_info/system_info.c b/components/nanobake/src/applications/system/system_info/system_info.c index 83e56938..bc5e0be9 100644 --- a/components/nanobake/src/applications/system/system_info/system_info.c +++ b/components/nanobake/src/applications/system/system_info/system_info.c @@ -33,6 +33,6 @@ NbApp system_info_app = { .name = "System Info", .type = SYSTEM, .entry_point = &system_info_entry_point, - .stack_size = 2048, - .priority = 10 + .stack_size = NB_TASK_STACK_SIZE_DEFAULT, + .priority = NB_TASK_PRIORITY_DEFAULT }; diff --git a/components/nanobake/src/nanobake.c b/components/nanobake/src/nanobake.c index a76505b2..184277e9 100644 --- a/components/nanobake/src/nanobake.c +++ b/components/nanobake/src/nanobake.c @@ -53,6 +53,7 @@ static void prv_start_app(const NbApp _Nonnull* app) { } furi_thread_set_appid(thread, app->id); + furi_thread_set_priority(thread, app->priority); furi_thread_start(thread); FuriThreadId thread_id = furi_thread_get_id(thread); diff --git a/components/nanobake/src/nb_app.h b/components/nanobake/src/nb_app.h index 1c5500e6..012c0c2b 100644 --- a/components/nanobake/src/nb_app.h +++ b/components/nanobake/src/nb_app.h @@ -17,6 +17,14 @@ typedef enum { USER } NbAppType; +typedef enum { + NB_TASK_PRIORITY_DEFAULT = 10 +} NbTaskPriority; + +typedef enum { + NB_TASK_STACK_SIZE_DEFAULT = 2048 +} NbStackSize; + typedef int32_t (*NbAppEntryPoint) (void _Nonnull* parameter); typedef struct { @@ -24,8 +32,8 @@ typedef struct { const char name[NB_APP_NAME_LENGTH]; const NbAppType type; const NbAppEntryPoint _Nullable entry_point; - const size_t stack_size; - const uint32_t priority; + const NbStackSize stack_size; + const NbTaskPriority priority; } NbApp; #ifdef __cplusplus diff --git a/components/nanobake/src/nb_hardware.c b/components/nanobake/src/nb_hardware.c index 7a3c7b1f..6a7a937d 100644 --- a/components/nanobake/src/nb_hardware.c +++ b/components/nanobake/src/nb_hardware.c @@ -3,7 +3,7 @@ #include "esp_err.h" #include "check.h" -#define TAG "nb_hardware" +#define TAG "hardware" NbHardware nb_hardware_create(NbConfig _Nonnull* config) { diff --git a/components/nanobake/src/nb_lvgl.c b/components/nanobake/src/nb_lvgl.c index 053ac832..95dbf277 100644 --- a/components/nanobake/src/nb_lvgl.c +++ b/components/nanobake/src/nb_lvgl.c @@ -2,7 +2,7 @@ #include "esp_lvgl_port.h" #include "check.h" -#define TAG "nb_lvgl" +#define TAG "lvgl" NbLvgl nb_lvgl_init(NbHardware _Nonnull* hardware) { const lvgl_port_cfg_t lvgl_cfg = { diff --git a/main/src/hello_world/hello_world.c b/main/src/hello_world/hello_world.c index b301a875..93e62626 100644 --- a/main/src/hello_world/hello_world.c +++ b/main/src/hello_world/hello_world.c @@ -70,6 +70,6 @@ const NbApp hello_world_app = { .name = "Hello World", .type = USER, .entry_point = &prv_hello_world_main, - .stack_size = 2048, - .priority = 10 + .stack_size = NB_TASK_STACK_SIZE_DEFAULT, + .priority = NB_TASK_PRIORITY_DEFAULT };