Boot splash and more (#98)
* Boot splash and more - Added developer sdkconfig - Refactored the way FreeRTOS includes are included - Improved Gui/Loader logic - Implemented boot app with splash screen * Updated naming for Gui and Loader services * Renamed Screenshot service methods * Renames * Service renames
This commit is contained in:
committed by
GitHub
parent
3f62ec2efa
commit
0188ce721c
@@ -1,14 +1,9 @@
|
||||
#include "Tactility.h"
|
||||
#include "service/gui/Gui_i.h"
|
||||
#include "service/loader/Loader.h"
|
||||
#include "service/loader/Loader_i.h"
|
||||
#include "lvgl/LvglKeypad.h"
|
||||
#include "lvgl/LvglSync.h"
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#else
|
||||
#include "FreeRTOS.h"
|
||||
#endif
|
||||
#include "RtosCompat.h"
|
||||
|
||||
namespace tt::service::gui {
|
||||
|
||||
@@ -25,9 +20,9 @@ void loader_callback(const void* message, TT_UNUSED void* context) {
|
||||
if (event->type == loader::LoaderEventTypeApplicationShowing) {
|
||||
app::App& app = event->app_showing.app;
|
||||
const app::Manifest& app_manifest = app.getManifest();
|
||||
show_app(app, app_manifest.onShow, app_manifest.onHide);
|
||||
showApp(app, app_manifest.onShow, app_manifest.onHide);
|
||||
} else if (event->type == loader::LoaderEventTypeApplicationHiding) {
|
||||
hide_app();
|
||||
hideApp();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +38,7 @@ Gui* gui_alloc() {
|
||||
);
|
||||
instance->mutex = tt_mutex_alloc(MutexTypeRecursive);
|
||||
instance->keyboard = nullptr;
|
||||
instance->loader_pubsub_subscription = tt_pubsub_subscribe(loader::get_pubsub(), &loader_callback, instance);
|
||||
instance->loader_pubsub_subscription = tt_pubsub_subscribe(loader::getPubsub(), &loader_callback, instance);
|
||||
tt_check(lvgl::lock(1000 / portTICK_PERIOD_MS));
|
||||
instance->keyboard_group = lv_group_create();
|
||||
instance->lvgl_parent = lv_scr_act();
|
||||
@@ -76,21 +71,21 @@ void unlock() {
|
||||
tt_check(tt_mutex_release(gui->mutex) == TtStatusOk);
|
||||
}
|
||||
|
||||
void request_draw() {
|
||||
void requestDraw() {
|
||||
tt_assert(gui);
|
||||
ThreadId thread_id = gui->thread->getId();
|
||||
thread_flags_set(thread_id, GUI_THREAD_FLAG_DRAW);
|
||||
}
|
||||
|
||||
void show_app(app::App& app, ViewPortShowCallback on_show, ViewPortHideCallback on_hide) {
|
||||
void showApp(app::App& app, ViewPortShowCallback on_show, ViewPortHideCallback on_hide) {
|
||||
lock();
|
||||
tt_check(gui->app_view_port == nullptr);
|
||||
gui->app_view_port = view_port_alloc(app, on_show, on_hide);
|
||||
unlock();
|
||||
request_draw();
|
||||
requestDraw();
|
||||
}
|
||||
|
||||
void hide_app() {
|
||||
void hideApp() {
|
||||
lock();
|
||||
ViewPort* view_port = gui->app_view_port;
|
||||
tt_check(view_port != nullptr);
|
||||
|
||||
Reference in New Issue
Block a user