Ken Van Hoeylandt 12a9839420
Various fixes and improvements (#177)
- Remove custom `ESP_TARGET` and use `ESP_PLATFORM` everywhere
- Add `Loader` service functionality to `tt::app::` namespace
- Make `Loader` `PubSub` usable by exposing the messages
- Add board type to crash log
- Don't show SD card in Files app when it's not mounted
- Set default SPI frequency for SD cards
- Move TT_VERSION to scope that works for sim too
- Log Tactility version and board on boot
- Rename "Yellow Board" to "CYD 2432S024C"
2025-01-21 21:55:54 +01:00

51 lines
1.4 KiB
C++

#pragma once
#include "app/AppManifest.h"
#include "app/AppInstance.h"
#include "EventFlag.h"
#include "MessageQueue.h"
#include "Pubsub.h"
#include "Thread.h"
#include "service/loader/Loader.h"
#include "RtosCompatSemaphore.h"
#include <stack>
#include <utility>
#include <DispatcherThread.h>
namespace tt::service::loader {
// region LoaderMessage
class LoaderMessageAppStart {
public:
std::string id;
std::shared_ptr<const Bundle> _Nullable parameters;
LoaderMessageAppStart() = default;
LoaderMessageAppStart(LoaderMessageAppStart& other) :
id(other.id),
parameters(other.parameters) {}
LoaderMessageAppStart(const std::string& id, std::shared_ptr<const Bundle> parameters) :
id(id),
parameters(std::move(parameters))
{}
~LoaderMessageAppStart() = default;
};
// endregion LoaderMessage
struct Loader {
std::shared_ptr<PubSub> pubsubExternal = std::make_shared<PubSub>();
Mutex mutex = Mutex(Mutex::Type::Recursive);
std::stack<std::shared_ptr<app::AppInstance>> appStack;
/** The dispatcher thread needs a callstack large enough to accommodate all the dispatched methods.
* This includes full LVGL redraw via Gui::redraw()
*/
std::unique_ptr<DispatcherThread> dispatcherThread = std::make_unique<DispatcherThread>("loader_dispatcher", 6144); // Files app requires ~5k
};
} // namespace