app-module events & callstack config, crash diagnostics (#630)

- Apps can specify task stack depth and preferred memory placement in their manifests.
- App identifiers are validated against length and character requirements.
- Crash diagnostics now show the crash cause, reason, fault address, call stack, and program-counter details, with logs saved for review.
- App closing is more consistent across built-in screens. There's now a dedicated function, and the old _emit() function is made private.
- Crash diagnostics no longer display a QR code without a call stack.
- Improved memory allocation for unrestricted requests.
This commit is contained in:
Ken Van Hoeylandt
2026-08-27 21:50:12 +02:00
committed by GitHub
parent c656ee9ffd
commit 92ca046681
74 changed files with 654 additions and 381 deletions
@@ -47,13 +47,7 @@ void onItemSelected(lv_event_t* e) {
auto* itemCtx = static_cast<ItemContext*>(lv_event_get_user_data(e));
LOG_I(TAG, "Selected item at index %d", (int)itemCtx->index);
itemCtx->ctx->result = itemCtx->index;
// Async, non-blocking - just wakes this dialog's own thread. Must NOT call
// app_manager_stop() here: that bound-waits (thread_join) for the dialog's thread to
// finish, which needs the LVGL lock (window_manager_remove()) - but this callback is
// running ON the LVGL task, which would deadlock against itself. The caller reaps this
// instance via app_manager_stop() after it receives the APP_EVENT_RESULT instead.
AppEvent event { .type = APP_EVENT_CLOSE, .timestamp = 0, .result = {} };
app_event_emit(itemCtx->ctx->appInstanceId, &event);
app_event_emit_close(itemCtx->ctx->appInstanceId);
}
void createChoiceItem(Context* ctx, lv_obj_t* list, const std::string& title, int32_t index) {
@@ -67,8 +61,7 @@ void createChoiceItem(Context* ctx, lv_obj_t* list, const std::string& title, in
// mirrors the original's 0-items (error) and 1-item (auto-select) shortcuts.
void closeWithResult(Context* ctx, int32_t result) {
ctx->result = result;
AppEvent event { .type = APP_EVENT_CLOSE, .timestamp = 0, .result = {} };
app_event_emit(ctx->appInstanceId, &event);
app_event_emit_close(ctx->appInstanceId);
}
void createWidgets(lv_obj_t* parent, void* userData) {