## Summary Properly implement `requestUpdateAndWait()` using freeRTOS direct task notification. FWIW, I think most of the current use cases of `requestUpdateAndWait()` are redundant, better to be replaced by `requestUpdate(true)`. But just keeping them in case we can find a proper use case for it in the future. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? **YES**, it's trivial, so I asked an AI to write the code --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
25 lines
914 B
C++
25 lines
914 B
C++
#include "Activity.h"
|
|
|
|
#include "ActivityManager.h"
|
|
|
|
void Activity::onEnter() { LOG_DBG("ACT", "Entering activity: %s", name.c_str()); }
|
|
|
|
void Activity::onExit() { LOG_DBG("ACT", "Exiting activity: %s", name.c_str()); }
|
|
|
|
void Activity::requestUpdate(bool immediate) { activityManager.requestUpdate(immediate); }
|
|
|
|
void Activity::requestUpdateAndWait() { activityManager.requestUpdateAndWait(); }
|
|
|
|
void Activity::onGoHome() { activityManager.goHome(); }
|
|
|
|
void Activity::onSelectBook(const std::string& path) { activityManager.goToReader(path); }
|
|
|
|
void Activity::startActivityForResult(std::unique_ptr<Activity>&& activity, ActivityResultHandler resultHandler) {
|
|
this->resultHandler = std::move(resultHandler);
|
|
activityManager.pushActivity(std::move(activity));
|
|
}
|
|
|
|
void Activity::setResult(ActivityResult&& result) { this->result = std::move(result); }
|
|
|
|
void Activity::finish() { activityManager.popActivity(); }
|