Fixes and improvements (#185)

- unPhone improvements related to power and boot (add boot count logging)
- Cleanup of Mutex acquire/release
- Removed `tt_assert()` in favour of `assert()`
- Fix sim build (likely failed due to migration of GitHub Actions to Ubuntu 24.04)
This commit is contained in:
Ken Van Hoeylandt
2025-01-24 22:49:29 +01:00
committed by GitHub
parent 3be251d8fb
commit d86dc40472
47 changed files with 223 additions and 177 deletions
+5 -5
View File
@@ -44,14 +44,14 @@ static Loader* loader_alloc() {
}
static void loader_free() {
tt_assert(loader_singleton != nullptr);
assert(loader_singleton != nullptr);
delete loader_singleton;
loader_singleton = nullptr;
}
void startApp(const std::string& id, std::shared_ptr<const Bundle> parameters) {
TT_LOG_I(TAG, "Start app %s", id.c_str());
tt_assert(loader_singleton);
assert(loader_singleton);
auto message = std::make_shared<LoaderMessageAppStart>(id, std::move(parameters));
loader_singleton->dispatcherThread->dispatch(onStartAppMessage, message);
}
@@ -63,7 +63,7 @@ void stopApp() {
}
std::shared_ptr<app::AppContext> _Nullable getCurrentAppContext() {
tt_assert(loader_singleton);
assert(loader_singleton);
if (loader_singleton->mutex.lock(10 / portTICK_PERIOD_MS)) {
auto app = loader_singleton->appStack.top();
loader_singleton->mutex.unlock();
@@ -79,7 +79,7 @@ std::shared_ptr<app::App> _Nullable getCurrentApp() {
}
std::shared_ptr<PubSub> getPubsub() {
tt_assert(loader_singleton);
assert(loader_singleton);
// it's safe to return pubsub without locking
// because it's never freed and loader is never exited
// also the loader instance cannot be obtained until the pubsub is created
@@ -256,7 +256,7 @@ static void stopAppInternal() {
// If there's a previous app, resume it
if (!loader_singleton->appStack.empty()) {
instance_to_resume = loader_singleton->appStack.top();
tt_assert(instance_to_resume);
assert(instance_to_resume);
transitionAppToState(instance_to_resume, app::StateShowing);
}