Merge develop into main (#6)

- Update TactilitySDK to `0.6.0-SNAPSHOT10`: Refactor `tt_app_registration()` for the related changes
- Fix for Diceware app hanging
- Deleted unused `assets/` in HelloWorld app
This commit is contained in:
Ken Van Hoeylandt
2025-10-05 21:16:39 +02:00
committed by GitHub
parent 37c5002c5d
commit e1579d3cbd
12 changed files with 44 additions and 52 deletions
+8 -10
View File
@@ -1,28 +1,26 @@
#include <tt_app.h> #include <tt_app.h>
#include "Calculator.h" #include "Calculator.h"
static void onShow(AppHandle appHandle, void* data, lv_obj_t* parent) { static void onShowApp(AppHandle appHandle, void* data, lv_obj_t* parent) {
static_cast<Calculator*>(data)->onShow(appHandle, parent); static_cast<Calculator*>(data)->onShow(appHandle, parent);
} }
static void* createApp() { static void* createAppData() {
return new Calculator(); return new Calculator();
} }
static void destroyApp(void* app) { static void destroyAppData(void* app) {
delete static_cast<Calculator*>(app); delete static_cast<Calculator*>(app);
} }
ExternalAppManifest manifest = {
.createData = createApp,
.destroyData = destroyApp,
.onShow = onShow,
};
extern "C" { extern "C" {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
tt_app_register(&manifest); tt_app_register((AppRegistration) {
.createData = createAppData,
.destroyData = destroyAppData,
.onShow = onShowApp,
});
return 0; return 0;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[manifest] [manifest]
version=0.1 version=0.1
[target] [target]
sdk=0.6.0-SNAPSHOT9 sdk=0.6.0-SNAPSHOT10
platforms=esp32,esp32s3 platforms=esp32,esp32s3
[app] [app]
id=one.tactility.calculator id=one.tactility.calculator
+4 -1
View File
@@ -72,6 +72,7 @@ void Application::cleanupJob() {
if (jobThread != nullptr) { if (jobThread != nullptr) {
tt_thread_join(jobThread, TT_MAX_TICKS); tt_thread_join(jobThread, TT_MAX_TICKS);
tt_thread_free(jobThread); tt_thread_free(jobThread);
jobThread = nullptr;
} }
} }
@@ -178,4 +179,6 @@ void Application::onShow(AppHandle appHandle, lv_obj_t* parent) {
lv_obj_set_style_text_align(resultLabel, LV_TEXT_ALIGN_CENTER, LV_STATE_DEFAULT); lv_obj_set_style_text_align(resultLabel, LV_TEXT_ALIGN_CENTER, LV_STATE_DEFAULT);
} }
void Application::onHide(AppHandle context) { cleanupJob(); } void Application::onHide(AppHandle context) {
cleanupJob();
}
+8 -10
View File
@@ -9,25 +9,23 @@ static void onHideApp(AppHandle appHandle, void* data) {
static_cast<Application*>(data)->onHide(appHandle); static_cast<Application*>(data)->onHide(appHandle);
} }
static void* createApp() { static void* createAppData() {
return new Application(); return new Application();
} }
static void destroyApp(void* app) { static void destroyAppData(void* app) {
delete static_cast<Application*>(app); delete static_cast<Application*>(app);
} }
ExternalAppManifest manifest = {
.createData = createApp,
.destroyData = destroyApp,
.onShow = onShowApp,
.onHide = onHideApp,
};
extern "C" { extern "C" {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
tt_app_register(&manifest); tt_app_register((AppRegistration) {
.createData = createAppData,
.destroyData = destroyAppData,
.onShow = onShowApp,
.onHide = onHideApp,
});
return 0; return 0;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[manifest] [manifest]
version=0.1 version=0.1
[target] [target]
sdk=0.6.0-SNAPSHOT9 sdk=0.6.0-SNAPSHOT10
platforms=esp32,esp32s3 platforms=esp32,esp32s3
[app] [app]
id=one.tactility.diceware id=one.tactility.diceware
+10 -12
View File
@@ -17,27 +17,25 @@ static void onHideApp(AppHandle appHandle, void* data) {
static_cast<Application*>(data)->onHide(appHandle); static_cast<Application*>(data)->onHide(appHandle);
} }
static void* createApp() { static void* createAppData() {
return new Application(); return new Application();
} }
static void destroyApp(void* app) { static void destroyAppData(void* app) {
delete static_cast<Application*>(app); delete static_cast<Application*>(app);
} }
ExternalAppManifest manifest = {
.createData = createApp,
.destroyData = destroyApp,
.onCreate = onCreateApp,
.onDestroy = onDestroyApp,
.onShow = onShowApp,
.onHide = onHideApp,
};
extern "C" { extern "C" {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
tt_app_register(&manifest); tt_app_register((AppRegistration) {
.createData = createAppData,
.destroyData = destroyAppData,
.onCreate = onCreateApp,
.onDestroy = onDestroyApp,
.onShow = onShowApp,
.onHide = onHideApp,
});
return 0; return 0;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[manifest] [manifest]
version=0.1 version=0.1
[target] [target]
sdk=0.6.0-SNAPSHOT9 sdk=0.6.0-SNAPSHOT10
platforms=esp32,esp32s3 platforms=esp32,esp32s3
[app] [app]
id=one.tactility.gpio id=one.tactility.gpio
+4 -6
View File
@@ -88,15 +88,13 @@ static void onDestroy(AppHandle appHandle, void* data) {
} }
} }
ExternalAppManifest manifest = {
.onCreate = onCreate,
.onDestroy = onDestroy
};
extern "C" { extern "C" {
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
tt_app_register(&manifest); tt_app_register((AppRegistration) {
.onCreate = onCreate,
.onDestroy = onDestroy
});
return 0; return 0;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[manifest] [manifest]
version=0.1 version=0.1
[target] [target]
sdk=0.6.0-SNAPSHOT9 sdk=0.6.0-SNAPSHOT10
platforms=esp32,esp32s3 platforms=esp32,esp32s3
[app] [app]
id=one.tactility.graphicsdemo id=one.tactility.graphicsdemo
-1
View File
@@ -1 +0,0 @@
Hello, world!
+5 -7
View File
@@ -1,11 +1,11 @@
#include <tt_app_manifest.h> #include <tt_app.h>
#include <tt_lvgl_toolbar.h> #include <tt_lvgl_toolbar.h>
/** /**
* Note: LVGL and Tactility methods need to be exposed manually from TactilityC/Source/tt_init.cpp * Note: LVGL and Tactility methods need to be exposed manually from TactilityC/Source/tt_init.cpp
* Only C is supported for now (C++ symbols fail to link) * Only C is supported for now (C++ symbols fail to link)
*/ */
static void onShow(AppHandle app, void* data, lv_obj_t* parent) { static void onShowApp(AppHandle app, void* data, lv_obj_t* parent) {
lv_obj_t* toolbar = tt_lvgl_toolbar_create_for_app(parent, app); lv_obj_t* toolbar = tt_lvgl_toolbar_create_for_app(parent, app);
lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0); lv_obj_align(toolbar, LV_ALIGN_TOP_MID, 0, 0);
@@ -14,11 +14,9 @@ static void onShow(AppHandle app, void* data, lv_obj_t* parent) {
lv_obj_align(label, LV_ALIGN_CENTER, 0, 0); lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);
} }
ExternalAppManifest manifest = {
.onShow = onShow
};
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
tt_app_register(&manifest); tt_app_register((AppRegistration) {
.onShow = onShowApp
});
return 0; return 0;
} }
+1 -1
View File
@@ -1,7 +1,7 @@
[manifest] [manifest]
version=0.1 version=0.1
[target] [target]
sdk=0.6.0-SNAPSHOT9 sdk=0.6.0-SNAPSHOT10
platforms=esp32,esp32s3 platforms=esp32,esp32s3
[app] [app]
id=one.tactility.helloworld id=one.tactility.helloworld