mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-10-20 20:35:08 +00:00
Compare commits
No commits in common. "8250566549189a1be363f69dc1bec448376c0cb4" and "9fe4753993812d5bdf734b5ad764f4f1eeb67d82" have entirely different histories.
8250566549
...
9fe4753993
@ -1,10 +1,10 @@
|
||||
# Architecture: App Framework
|
||||
|
||||
Apps are event-driven, C API (`app-module`, `<app/*.h>`), not a C++ class. Each app has an `AppManifest` (`id`, `name`, `category`, `location`, `flags`) and a `main(argc, argv)` entry point (`AppMainFn`), modelled on a C program's `main()`. Every app instance gets its own dedicated task for its whole lifetime, and blocks in that task until it returns. Use `app_scheduler_current_app_id()` (`app/scheduler.h`) to identify the running instance - it's not passed as a parameter.
|
||||
Apps are event-driven, C API (`app-module`, `<app/*.h>`), not a C++ class. Each app has an `AppManifest` (`id`, `name`, `category`, `location`, `flags`) and a `main(app_instance_id, argc, argv)` entry point (`AppMainFn`), modelled on a C program's `main()`. Every app instance gets its own dedicated task for its whole lifetime, and blocks in that task until it returns.
|
||||
|
||||
Lifecycle and inter-app communication go through `app_manager_*()` (`app/manager.h`) and `app_event_*()` (`app/event.h`):
|
||||
- `app_manager_start()`/`app_manager_start_with_parameters()` launch a plain instance; `app_manager_start_for_result()` launches a modal child that reports back to a parent instance.
|
||||
- An app subscribes with `app_event_subscribe()` (registers for its own instance's events, no id argument needed), blocks via `task_event_group_wait()`/`task_event_group_wait_any()`, and drains with `app_event_poll()`, reacting to `APP_EVENT_CLOSE` (terminate now) and `APP_EVENT_RESULT` (a child it started reported back).
|
||||
- An app subscribes with `app_event_subscribe()`, blocks via `task_event_group_wait()`/`task_event_group_wait_any()`, and drains with `app_event_poll()`, reacting to `APP_EVENT_CLOSE` (terminate now) and `APP_EVENT_RESULT` (a child it started reported back).
|
||||
- An app closes itself by calling `app_manager_finish()` right before returning from `main()`; another instance is closed via `app_manager_stop()`.
|
||||
|
||||
Apps are registered at startup via `app_manager_add()`. External apps can be loaded from SD card via `manifest.properties` files, or side-loaded as ELF binaries on ESP32 (see `app/loader.h`'s `AppLoaderApi`).
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -48,6 +48,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -46,6 +46,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -23,6 +23,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gpio0 {
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -21,6 +21,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
|
||||
wifi0 {
|
||||
compatible = "espressif,esp32-wifi-pinned";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ble0 {
|
||||
|
||||
@ -11,9 +11,6 @@
|
||||
|
||||
## Higher Priority
|
||||
|
||||
- Apps should be able to specify stack size in their manifest
|
||||
- Apps currently have a `Context` object with an `appInstanceId` in it, purely for being able to close the app.
|
||||
Change it so that the app has its own termination signal that it waits for in the loop, it should subscribe to the event group.
|
||||
- stopAppFromToolbar() in Tactility.cpp stops the top-most app. Change it so the toolbar knows for which app id it is created, so it can rely on that.
|
||||
- Warn if file operations are done from prohibited tasks (e.g. lvgl task)
|
||||
- AppHubApp: Prevent download callbacks from accessing a destroyed view.
|
||||
|
||||
@ -50,21 +50,19 @@ struct AppEvent {
|
||||
* Caller-owned subscription node. Unlike TactilityKernel's system_event poll subscription
|
||||
* (which coalesces to the latest value), this queues events by value (FIFO) since dropping an
|
||||
* APP_EVENT_RESULT would be unacceptable.
|
||||
* @warning Fields other than `bit` are for internal use only; do not read or write them
|
||||
* directly.
|
||||
* @warning Fields other than `app_instance_id` and `bit` are for internal use only; do not read
|
||||
* or write them directly.
|
||||
*/
|
||||
struct AppEventSubscription {
|
||||
/** Set by app_event_subscribe()/app_event_subscribe_with_app_id(). Read-only for the
|
||||
* caller: OR it into a task_event_group_wait() mask (alongside other subscriptions sharing
|
||||
* the same `event_group`) to block on this subscription and other event sources with one
|
||||
* call. */
|
||||
/** The app instance this subscription receives events for; set by the caller before app_event_subscribe(). */
|
||||
AppInstanceId app_instance_id;
|
||||
|
||||
/** Set by app_event_subscribe(). Read-only for the caller: OR it into a
|
||||
* task_event_group_wait() mask (alongside other subscriptions sharing the same
|
||||
* `event_group`) to block on this subscription and other event sources with one call. */
|
||||
uint32_t bit;
|
||||
|
||||
struct {
|
||||
/** The app instance this subscription receives events for; set by
|
||||
* app_event_subscribe()/app_event_subscribe_with_app_id(). */
|
||||
AppInstanceId app_instance_id;
|
||||
|
||||
/** Caller-owned, borrowed; set by app_event_subscribe(). */
|
||||
struct TaskEventGroup* event_group;
|
||||
|
||||
@ -77,11 +75,10 @@ struct AppEventSubscription {
|
||||
};
|
||||
|
||||
/**
|
||||
* Register a subscription for events addressed to the calling app's own instance (identified via
|
||||
* app_scheduler_current_app_id()).
|
||||
* @warning Does not work in ISR context. Must be called from the app's own task.
|
||||
* @param[in,out] sub subscription to register; owns the storage, must stay alive (and
|
||||
* stationary) until unsubscribed
|
||||
* Register a subscription for events addressed to @a sub->app_instance_id.
|
||||
* @warning Does not work in ISR context.
|
||||
* @param[in,out] sub subscription to register; caller sets @a sub->app_instance_id beforehand,
|
||||
* owns the storage, and must keep it alive (and stationary) until unsubscribed
|
||||
* @param[in] event_group caller-owned group to wait on; must outlive @a sub (i.e. be
|
||||
* destructed only after app_event_unsubscribe()). To block for an event, call
|
||||
* task_event_group_wait()/task_event_group_wait_any() on this group (OR sub->bit into the mask,
|
||||
@ -92,21 +89,6 @@ struct AppEventSubscription {
|
||||
*/
|
||||
error_t app_event_subscribe(struct AppEventSubscription* sub, struct TaskEventGroup* event_group);
|
||||
|
||||
/**
|
||||
* Same as app_event_subscribe(), but for a caller that isn't running on @a app_instance_id's own
|
||||
* task (e.g. test code simulating multiple distinct app instances from one thread). Production
|
||||
* app code should use app_event_subscribe() instead.
|
||||
* @warning Does not work in ISR context.
|
||||
* @param[in,out] sub subscription to register; owns the storage, must stay alive (and
|
||||
* stationary) until unsubscribed
|
||||
* @param[in] event_group caller-owned group to wait on; same contract as app_event_subscribe()
|
||||
* @param[in] app_instance_id the app instance this subscription receives events for
|
||||
* @retval ERROR_NONE on success
|
||||
* @retval ERROR_RESOURCE @a event_group has no free bits left to claim; @a sub was not registered
|
||||
* @retval ERROR_INVALID_STATE @a sub is already registered
|
||||
*/
|
||||
error_t app_event_subscribe_with_app_id(struct AppEventSubscription* sub, struct TaskEventGroup* event_group, AppInstanceId app_instance_id);
|
||||
|
||||
/**
|
||||
* Remove a previously registered subscription.
|
||||
* @warning Does not work in ISR context.
|
||||
|
||||
@ -21,13 +21,13 @@ extern "C" {
|
||||
/**
|
||||
* Entry point signature for an APP_LOCATION_MEMORY app: a function linked directly into this
|
||||
* firmware binary. Called on the dedicated task app-module's scheduler spawns for this instance,
|
||||
* blocking for the app's whole lifetime - same contract as an external app's main(). Use
|
||||
* app_scheduler_current_app_id() to identify this running instance (e.g. with
|
||||
* blocking for the app's whole lifetime - same contract as an external app's main(), plus
|
||||
* @a app_instance_id identifying this running instance (use it with
|
||||
* app_event_subscribe()/window_manager_create()/etc.). The instance closes when this function
|
||||
* returns - no separate call is needed.
|
||||
* AppManifest::location.location holds this cast to void*.
|
||||
*/
|
||||
typedef int32_t (*AppMainFn)(int argc, char* argv[]);
|
||||
typedef int32_t (*AppMainFn)(uint32_t app_instance_id, int argc, char* argv[]);
|
||||
|
||||
typedef void* AppRuntime;
|
||||
|
||||
|
||||
@ -16,9 +16,9 @@ error_t api_load(AppLocation location, AppRuntime* out_runtime) {
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
int32_t api_run(AppRuntime runtime, uint32_t /*app_instance_id*/, int argc, char* argv[]) {
|
||||
int32_t api_run(AppRuntime runtime, uint32_t app_instance_id, int argc, char* argv[]) {
|
||||
auto entry = reinterpret_cast<AppMainFn>(runtime);
|
||||
return entry(argc, argv);
|
||||
return entry(app_instance_id, argc, argv);
|
||||
}
|
||||
|
||||
void api_unload(AppRuntime /*unused*/) {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#include <app/event.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <tactility/concurrent/mutex.h>
|
||||
#include <tactility/time.h>
|
||||
@ -22,7 +21,7 @@ static AppEventMutex subscriptions_mutex;
|
||||
|
||||
extern "C" {
|
||||
|
||||
error_t app_event_subscribe_with_app_id(AppEventSubscription* sub, TaskEventGroup* event_group, AppInstanceId app_instance_id) {
|
||||
error_t app_event_subscribe(AppEventSubscription* sub, TaskEventGroup* event_group) {
|
||||
uint32_t bit;
|
||||
error_t claim_result = task_event_group_claim_bit(event_group, &bit);
|
||||
if (claim_result != ERROR_NONE) {
|
||||
@ -39,7 +38,6 @@ error_t app_event_subscribe_with_app_id(AppEventSubscription* sub, TaskEventGrou
|
||||
}
|
||||
|
||||
sub->bit = bit;
|
||||
sub->internal.app_instance_id = app_instance_id;
|
||||
sub->internal.event_group = event_group;
|
||||
sub->internal.head = 0;
|
||||
sub->internal.count = 0;
|
||||
@ -50,10 +48,6 @@ error_t app_event_subscribe_with_app_id(AppEventSubscription* sub, TaskEventGrou
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
error_t app_event_subscribe(AppEventSubscription* sub, TaskEventGroup* event_group) {
|
||||
return app_event_subscribe_with_app_id(sub, event_group, app_scheduler_current_app_id());
|
||||
}
|
||||
|
||||
error_t app_event_unsubscribe(AppEventSubscription* sub) {
|
||||
error_t result = ERROR_NOT_FOUND;
|
||||
|
||||
@ -82,7 +76,7 @@ error_t app_event_emit(AppInstanceId app_instance_id, const AppEvent* event) {
|
||||
|
||||
mutex_lock(&subscriptions_mutex.handle);
|
||||
for (AppEventSubscription* sub = subscriptions; sub != nullptr; sub = sub->internal.next) {
|
||||
if (sub->internal.app_instance_id != app_instance_id) {
|
||||
if (sub->app_instance_id != app_instance_id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@ extern ServiceManifest app_internal_loader_service_manifest;
|
||||
const ModuleSymbol app_module_symbols[] = {
|
||||
// app/event
|
||||
DEFINE_MODULE_SYMBOL(app_event_subscribe),
|
||||
DEFINE_MODULE_SYMBOL(app_event_subscribe_with_app_id),
|
||||
DEFINE_MODULE_SYMBOL(app_event_unsubscribe),
|
||||
DEFINE_MODULE_SYMBOL(app_event_emit),
|
||||
DEFINE_MODULE_SYMBOL(app_event_poll),
|
||||
|
||||
@ -11,7 +11,8 @@ TEST_CASE("app_event_subscribe/_poll deliver events in FIFO order") {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
CHECK_EQ(app_event_subscribe_with_app_id(&sub, &event_group, 1), ERROR_NONE);
|
||||
sub.app_instance_id = 1;
|
||||
CHECK_EQ(app_event_subscribe(&sub, &event_group), ERROR_NONE);
|
||||
|
||||
for (uint32_t i = 0; i < 3; i++) {
|
||||
AppEvent event { .type = APP_EVENT_RESULT, .timestamp = 0, .result = { .launch_id = i, .result = 0 } };
|
||||
@ -34,7 +35,8 @@ TEST_CASE("app_event_emit only delivers to subscriptions for that app_instance_i
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
app_event_subscribe_with_app_id(&sub, &event_group, 10);
|
||||
sub.app_instance_id = 10;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
AppEvent event { .type = APP_EVENT_CLOSE, .timestamp = 0, .result = {} };
|
||||
CHECK_EQ(app_event_emit(11, &event), ERROR_NOT_FOUND);
|
||||
@ -51,7 +53,8 @@ TEST_CASE("app_event_emit returns ERROR_RESOURCE and drops the newest event once
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
app_event_subscribe_with_app_id(&sub, &event_group, 20);
|
||||
sub.app_instance_id = 20;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
for (uint32_t i = 0; i < APP_EVENT_QUEUE_CAPACITY; i++) {
|
||||
AppEvent event { .type = APP_EVENT_RESULT, .timestamp = 0, .result = { .launch_id = i, .result = 0 } };
|
||||
@ -80,7 +83,8 @@ TEST_CASE("app_event_unsubscribe stops further delivery") {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
app_event_subscribe_with_app_id(&sub, &event_group, 30);
|
||||
sub.app_instance_id = 30;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
CHECK_EQ(app_event_unsubscribe(&sub), ERROR_NONE);
|
||||
CHECK_EQ(app_event_unsubscribe(&sub), ERROR_NOT_FOUND);
|
||||
@ -96,7 +100,8 @@ TEST_CASE("app_event_poll times out when no event has arrived") {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
app_event_subscribe_with_app_id(&sub, &event_group, 40);
|
||||
sub.app_instance_id = 40;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
AppEvent out {};
|
||||
CHECK_EQ(app_event_poll(&sub, &out), ERROR_TIMEOUT);
|
||||
@ -110,7 +115,8 @@ TEST_CASE("app_event_emit stamps the event with the current boot-relative time")
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
app_event_subscribe_with_app_id(&sub, &event_group, 50);
|
||||
sub.app_instance_id = 50;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
auto before = static_cast<uint64_t>(get_micros_since_boot());
|
||||
AppEvent event { .type = APP_EVENT_CLOSE, .timestamp = 0, .result = {} };
|
||||
@ -131,7 +137,8 @@ TEST_CASE("task_event_group_wait wakes when the event is emitted from another ta
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
CHECK_EQ(app_event_subscribe_with_app_id(&sub, &event_group, 60), ERROR_NONE);
|
||||
sub.app_instance_id = 60;
|
||||
CHECK_EQ(app_event_subscribe(&sub, &event_group), ERROR_NONE);
|
||||
|
||||
auto* thread = thread_alloc_full(
|
||||
"app-event-emitter",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/loader.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <service/manager.h>
|
||||
|
||||
@ -56,7 +55,7 @@ void stash_received_arguments(int argc, char* argv[]) {
|
||||
// parameter (app_manager_start_for_result()), acts as a modal dialog instead: returns the
|
||||
// requested result (argv[0], parsed as an int) immediately (the app's own return value IS the
|
||||
// delivered APP_EVENT_RESULT.result - see app_scheduler.cpp's thread_main()).
|
||||
int32_t fake_run(void*, uint32_t /*app_instance_id*/, int argc, char* argv[]) {
|
||||
int32_t fake_run(void*, uint32_t app_instance_id, int argc, char* argv[]) {
|
||||
stash_received_arguments(argc, argv);
|
||||
|
||||
if (argc == 1) {
|
||||
@ -71,6 +70,7 @@ int32_t fake_run(void*, uint32_t /*app_instance_id*/, int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
sub.app_instance_id = app_instance_id;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
while (true) {
|
||||
@ -139,8 +139,8 @@ void ensure_memory_loader_registered() {
|
||||
|
||||
// Same subscribe-until-close contract as fake_run() above, but called directly as an AppMainFn -
|
||||
// this is what a real internal app's entry point looks like.
|
||||
int32_t fake_app_main(int argc, char* argv[]) {
|
||||
return fake_run(nullptr, app_scheduler_current_app_id(), argc, argv);
|
||||
int32_t fake_app_main(uint32_t app_instance_id, int argc, char* argv[]) {
|
||||
return fake_run(nullptr, app_instance_id, argc, argv);
|
||||
}
|
||||
|
||||
// Wraps app_manager_get_topmost_instance_id() for terse assertions: 0 if no app is Active.
|
||||
@ -343,7 +343,8 @@ TEST_CASE("app_manager_start_for_result delivers APP_EVENT_RESULT to the parent,
|
||||
task_event_group_construct(&parent_event_group);
|
||||
|
||||
AppEventSubscription parent_sub {};
|
||||
REQUIRE_EQ(app_event_subscribe_with_app_id(&parent_sub, &parent_event_group, parent_id), ERROR_NONE);
|
||||
parent_sub.app_instance_id = parent_id;
|
||||
REQUIRE_EQ(app_event_subscribe(&parent_sub, &parent_event_group), ERROR_NONE);
|
||||
|
||||
const char* argv[] = { "42" };
|
||||
uint32_t child_id = 0;
|
||||
@ -383,7 +384,8 @@ TEST_CASE("app_manager_start_for_result delivers the child's own return value as
|
||||
task_event_group_construct(&parent_event_group);
|
||||
|
||||
AppEventSubscription parent_sub {};
|
||||
REQUIRE_EQ(app_event_subscribe_with_app_id(&parent_sub, &parent_event_group, parent_id), ERROR_NONE);
|
||||
parent_sub.app_instance_id = parent_id;
|
||||
REQUIRE_EQ(app_event_subscribe(&parent_sub, &parent_event_group), ERROR_NONE);
|
||||
|
||||
uint32_t child_id = 0;
|
||||
// No parameters - fake_run falls through to its normal CLOSE loop instead of acting as a
|
||||
|
||||
@ -14,7 +14,8 @@ TEST_CASE("a task can wait on app_event and system_event together via one TaskEv
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription app_sub {};
|
||||
CHECK_EQ(app_event_subscribe_with_app_id(&app_sub, &event_group, 100), ERROR_NONE);
|
||||
app_sub.app_instance_id = 100;
|
||||
CHECK_EQ(app_event_subscribe(&app_sub, &event_group), ERROR_NONE);
|
||||
|
||||
SystemEventSubscription sys_sub {};
|
||||
sys_sub.event.type = KERNEL_EVENT_BOOT_COMPLETED;
|
||||
|
||||
@ -5,13 +5,11 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl/icons/shared.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/drivers/uart_controller.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
@ -201,8 +199,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
// endregion
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -210,7 +207,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -235,7 +233,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -3,11 +3,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -99,8 +97,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx { appInstanceId };
|
||||
ctx.argc = argc;
|
||||
ctx.argv = argv;
|
||||
@ -109,7 +106,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -128,7 +126,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return ctx.result;
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/install.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <format>
|
||||
|
||||
@ -16,7 +15,6 @@
|
||||
#include <Tactility/file/File.h>
|
||||
#include <Tactility/lvgl/Style.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
constexpr auto* TAG = "AppDetails";
|
||||
@ -106,8 +104,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
@ -121,7 +118,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -152,7 +150,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -10,11 +10,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
@ -199,8 +197,7 @@ void destroyWidgets(void* userData) {
|
||||
ctx->refreshButton = nullptr;
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx;
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -208,7 +205,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create_ext(appInstanceId, createWidgets, destroyWidgets, &ctx);
|
||||
|
||||
@ -230,7 +228,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -11,14 +11,12 @@
|
||||
#include <app/metadata.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <atomic>
|
||||
@ -213,8 +211,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
updateViews(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
// argv layout: [0]=appId, [1]=appVersionName, [2]=appVersionCode, [3]=appName,
|
||||
// [4]=appDescription, [5]=targetSdk, [6]=file, [7..argc)=targetPlatforms.
|
||||
|
||||
@ -237,7 +234,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -271,7 +269,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
@ -81,15 +78,15 @@ void createWidgets(lv_obj_t* parent, void*) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
appListInstanceId = appInstanceId;
|
||||
|
||||
TaskEventGroup event_group {};
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, nullptr);
|
||||
|
||||
@ -108,7 +105,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -6,12 +6,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
#include <lvgl.h>
|
||||
#include <algorithm>
|
||||
@ -90,15 +87,15 @@ void createWidgets(lv_obj_t* parent, void*) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
appSettingsInstanceId = appInstanceId;
|
||||
|
||||
TaskEventGroup event_group {};
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, nullptr);
|
||||
|
||||
@ -120,7 +117,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -7,13 +7,11 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
namespace tt::app::apwebserver {
|
||||
@ -123,8 +121,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
ctx->webServerEnabledChanged = true;
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.wsSettings = settings::webserver::loadOrGetDefault();
|
||||
@ -133,7 +130,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -174,7 +172,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
});
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -5,12 +5,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/widgets/sliderbox.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
@ -214,8 +211,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
});
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -223,7 +219,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -250,7 +247,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#include "tactility/system_event.h"
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/delay.h>
|
||||
#include <tactility/drivers/backlight.h>
|
||||
#include <tactility/drivers/display.h>
|
||||
@ -10,7 +9,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -286,8 +284,7 @@ void runBootSequence(TickType_t startTime) {
|
||||
system_event_emit(KERNEL_EVENT_BOOT_COMPLETED, nullptr, 0);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
bootAppInstanceId = appInstanceId;
|
||||
const auto start_time = get_ticks();
|
||||
|
||||
@ -299,7 +296,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
bootWindowId = window_manager_create(appInstanceId, createSplashWidgets, nullptr);
|
||||
|
||||
@ -325,7 +323,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
if (bootWindowId != 0) {
|
||||
window_manager_remove(bootWindowId);
|
||||
}
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -8,11 +8,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
namespace tt::app::btmanage {
|
||||
@ -201,8 +199,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
ctx->unlock();
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx;
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.bindings = (Bindings) {
|
||||
@ -227,7 +224,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -277,7 +275,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -11,11 +11,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/bluetooth.h>
|
||||
#include <tactility/log.h>
|
||||
@ -180,8 +178,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
updateViews(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
@ -206,7 +203,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -247,7 +245,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -10,11 +10,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
@ -169,8 +167,7 @@ void switchChannel(Context* ctx, const std::string& chatChannel) {
|
||||
|
||||
namespace {
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.isFirstLaunch = !settingsFileExists();
|
||||
@ -192,7 +189,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -214,7 +212,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
service::espnow::unsubscribeReceiver(ctx.receiveSubscription);
|
||||
|
||||
@ -8,13 +8,11 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <qrcode.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/drivers/pointer.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
@ -151,8 +149,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -160,7 +157,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -184,7 +182,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
bool continuePressed = ctx.continuePressed;
|
||||
|
||||
@ -10,11 +10,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -164,8 +162,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
updateViewState(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.service = service::development::findService();
|
||||
@ -181,7 +178,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -223,7 +221,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
lvgl_unlock();
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/backlight.h>
|
||||
#include <tactility/drivers/display.h>
|
||||
@ -14,7 +13,6 @@
|
||||
|
||||
#include <app/event.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -305,8 +303,7 @@ void persistIfUpdated(Context& ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -314,7 +311,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -337,7 +335,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -4,12 +4,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace tt::app::files {
|
||||
@ -28,8 +25,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
ctx->view->init(ctx->appInstanceId, parent);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
auto state = std::make_shared<State>();
|
||||
View view(state);
|
||||
CreateContext createContext { &view, appInstanceId };
|
||||
@ -38,7 +34,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &createContext);
|
||||
|
||||
@ -65,7 +62,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
|
||||
view.deinit();
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -5,12 +5,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@ -46,8 +43,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
ctx->view->init(parent, ctx->mode);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
// argv layout: [0]="existing" or "existing_or_new".
|
||||
|
||||
Context ctx {};
|
||||
@ -70,7 +66,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -89,7 +86,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return ctx.result;
|
||||
|
||||
@ -9,11 +9,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/time.h>
|
||||
|
||||
@ -259,8 +257,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
updateDeviceStates(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -274,7 +271,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
ctx.timer->start();
|
||||
@ -318,7 +316,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
|
||||
ctx.timer->stop();
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -2,14 +2,12 @@
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/grove.h>
|
||||
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -91,8 +89,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -100,7 +97,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -122,7 +120,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -9,11 +9,9 @@
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/paths.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/drivers/i2c_controller.h>
|
||||
#include <tactility/log.h>
|
||||
#include <tactility/preferences.h>
|
||||
@ -386,8 +384,7 @@ void stopScanningIfRunning(Context* ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx;
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -395,7 +392,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -418,7 +416,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -7,7 +7,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -83,8 +82,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
check(argc > 0, "Parameters not set");
|
||||
|
||||
Context ctx {};
|
||||
@ -95,7 +93,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -117,7 +116,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -3,12 +3,10 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -108,8 +106,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
createButton(ctx, button_wrapper, "Cancel", nullptr);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx { appInstanceId };
|
||||
ctx.argc = argc;
|
||||
ctx.argv = argv;
|
||||
@ -118,7 +115,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -137,7 +135,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return ctx.result;
|
||||
|
||||
@ -7,11 +7,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/backlight.h>
|
||||
|
||||
@ -207,8 +205,7 @@ void persistIfUpdated(Context& ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -216,7 +213,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -239,7 +237,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@ -15,7 +14,6 @@
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/power_supply.h>
|
||||
#include <tactility/log.h>
|
||||
@ -233,15 +231,15 @@ void runAutoStart() {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
runAutoStart();
|
||||
|
||||
TaskEventGroup event_group {};
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, nullptr);
|
||||
|
||||
@ -262,7 +260,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -9,12 +9,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -144,8 +141,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
lv_obj_add_event_cb(ctx->languageDropdown, onLanguageSet, LV_EVENT_VALUE_CHANGED, ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx;
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -153,7 +149,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -175,7 +172,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -5,14 +5,12 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
namespace tt::app::notes {
|
||||
@ -184,8 +182,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
@ -197,7 +194,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -241,7 +239,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -4,11 +4,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/power_supply.h>
|
||||
#include <tactility/time.h>
|
||||
@ -231,8 +229,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -247,7 +244,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
ctx.timer->start();
|
||||
@ -271,7 +269,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
|
||||
ctx.timer->stop();
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -4,13 +4,11 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <lvgl/fonts.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/drivers/power_supply.h>
|
||||
|
||||
@ -134,8 +132,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
lv_obj_add_event_cb(no_button, onNoPressed, LV_EVENT_SHORT_CLICKED, ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -143,7 +140,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -165,7 +163,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -12,11 +12,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -242,8 +240,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.updateTimer = std::make_unique<Timer>(Timer::Type::Periodic, 500 / portTICK_PERIOD_MS, [&ctx] {
|
||||
@ -257,7 +254,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -283,7 +281,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -3,11 +3,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -101,8 +99,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
AppInstanceId appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(AppInstanceId appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx { appInstanceId };
|
||||
ctx.argc = argc;
|
||||
ctx.argv = argv;
|
||||
@ -111,7 +108,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -130,7 +128,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return ctx.result;
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -77,15 +76,15 @@ void createWidgets(lv_obj_t* parent, void*) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
settingsInstanceId = appInstanceId;
|
||||
|
||||
TaskEventGroup event_group {};
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, nullptr);
|
||||
|
||||
@ -104,7 +103,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -11,11 +11,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl/fonts.h>
|
||||
@ -205,8 +203,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
renderCurrent(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.steps = {
|
||||
@ -236,7 +233,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -265,7 +263,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
#include <tactility/check.h>
|
||||
#include "tactility/time.h"
|
||||
|
||||
#include <Tactility/DeprecatedPaths.h>
|
||||
@ -9,7 +8,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -401,8 +399,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
updateTasks(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -424,7 +421,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
ctx.memoryTimer->start(); // Memory: every 10s
|
||||
@ -450,7 +448,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
ctx.memoryTimer->stop();
|
||||
ctx.tasksTimer->stop();
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -6,11 +6,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
@ -155,8 +153,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
lv_label_set_text(ctx->timeZoneLabel, timeZoneName.c_str());
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -164,7 +161,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -201,7 +199,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -9,11 +9,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
@ -231,8 +229,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
ctx->listWidget = list;
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
// argv layout: [0]="1"/"0" (saveTimeZone).
|
||||
|
||||
Context ctx;
|
||||
@ -247,7 +244,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
ctx.updateTimer->start();
|
||||
@ -268,7 +266,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
|
||||
ctx.updateTimer->stop();
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return ctx.result;
|
||||
|
||||
@ -8,11 +8,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/devices/pointer.h>
|
||||
@ -223,8 +221,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
updateUi(ctx);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -240,7 +237,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -262,7 +260,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
// finishCalibration() already applied a new calibration on success. On cancel/failure,
|
||||
|
||||
@ -5,7 +5,6 @@
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/drivers/trackball.h>
|
||||
|
||||
#include <Tactility/Assets.h>
|
||||
@ -15,7 +14,6 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
@ -270,8 +268,7 @@ void persistIfUpdated(Context& ctx) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -279,7 +276,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -302,7 +300,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -3,12 +3,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
|
||||
@ -84,8 +81,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
|
||||
@ -93,7 +89,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -115,7 +112,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -8,11 +8,9 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@ -356,8 +354,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
"AP mode uses the password configured above.");
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
ctx.wsSettings = settings::webserver::loadOrGetDefault();
|
||||
@ -369,7 +366,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
WindowId window = window_manager_create(appInstanceId, createWidgets, &ctx);
|
||||
|
||||
@ -429,7 +427,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -6,14 +6,12 @@
|
||||
#include <app/event.h>
|
||||
#include <app/manager.h>
|
||||
#include <app/manifest.h>
|
||||
#include <app/scheduler.h>
|
||||
|
||||
#include <lvgl_window_manager/window_manager.h>
|
||||
|
||||
#include <lvgl/lvgl.h>
|
||||
#include <lvgl/widgets/toolbar.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
#include <tactility/log.h>
|
||||
|
||||
@ -217,8 +215,7 @@ void createWidgets(lv_obj_t* parent, void* userData) {
|
||||
lv_obj_align(ctx->autoConnectSwitch, LV_ALIGN_RIGHT_MID, 0, 0);
|
||||
}
|
||||
|
||||
int32_t appMain(int argc, char* argv[]) {
|
||||
uint32_t appInstanceId = app_scheduler_current_app_id();
|
||||
int32_t appMain(uint32_t appInstanceId, int argc, char* argv[]) {
|
||||
|
||||
Context ctx {};
|
||||
ctx.appInstanceId = appInstanceId;
|
||||
@ -228,7 +225,8 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
task_event_group_construct(&event_group);
|
||||
|
||||
AppEventSubscription sub {};
|
||||
check(app_event_subscribe(&sub, &event_group) == ERROR_NONE);
|
||||
sub.app_instance_id = appInstanceId;
|
||||
app_event_subscribe(&sub, &event_group);
|
||||
|
||||
Device* wifi_device = nullptr;
|
||||
if (device_get_first_by_type(&WIFI_TYPE, &wifi_device) == ERROR_NONE) {
|
||||
@ -310,7 +308,7 @@ int32_t appMain(int argc, char* argv[]) {
|
||||
device_put(ctx.wifiDevice);
|
||||
}
|
||||
window_manager_remove(window);
|
||||
check(app_event_unsubscribe(&sub) == ERROR_NONE);
|
||||
app_event_unsubscribe(&sub);
|
||||
task_event_group_destruct(&event_group);
|
||||
|
||||
return 0;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user