mirror of
https://github.com/usatiuk/cardboy.git
synced 2025-10-28 23:27:49 +01:00
fix hanging
This commit is contained in:
@@ -61,6 +61,7 @@ private:
|
||||
class HighResClockService;
|
||||
class PowerService;
|
||||
class FilesystemService;
|
||||
class LoopHooksService;
|
||||
|
||||
std::unique_ptr<BuzzerService> buzzerService;
|
||||
std::unique_ptr<BatteryService> batteryService;
|
||||
@@ -70,6 +71,7 @@ private:
|
||||
std::unique_ptr<PowerService> powerService;
|
||||
std::unique_ptr<FilesystemService> filesystemService;
|
||||
std::unique_ptr<EventBus> eventBus;
|
||||
std::unique_ptr<LoopHooksService> loopHooksService;
|
||||
|
||||
cardboy::sdk::Services services{};
|
||||
};
|
||||
|
||||
@@ -128,6 +128,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class EspRuntime::LoopHooksService final : public cardboy::sdk::ILoopHooks {
|
||||
public:
|
||||
void onLoopIteration() override { vTaskDelay(1); }
|
||||
};
|
||||
|
||||
EspRuntime::EspRuntime() : framebuffer(), input(), clock() {
|
||||
initializeHardware();
|
||||
|
||||
@@ -139,6 +144,7 @@ EspRuntime::EspRuntime() : framebuffer(), input(), clock() {
|
||||
powerService = std::make_unique<PowerService>();
|
||||
filesystemService = std::make_unique<FilesystemService>();
|
||||
eventBus = std::make_unique<EventBus>();
|
||||
loopHooksService = std::make_unique<LoopHooksService>();
|
||||
|
||||
services.buzzer = buzzerService.get();
|
||||
services.battery = batteryService.get();
|
||||
@@ -148,6 +154,7 @@ EspRuntime::EspRuntime() : framebuffer(), input(), clock() {
|
||||
services.powerManager = powerService.get();
|
||||
services.filesystem = filesystemService.get();
|
||||
services.eventBus = eventBus.get();
|
||||
services.loopHooks = loopHooksService.get();
|
||||
|
||||
Buttons::get().setEventBus(eventBus.get());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user