Skip to content

Commit

Permalink
♻️ (OS): Add ActivityKit in OS
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Sep 5, 2022
1 parent 4fff18d commit 98b2a58
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/os/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ target_link_libraries(LekaOS
CoreBufferedSerial
CoreRFIDReader
RFIDKit
ActivityKit
)

target_link_custom_leka_targets(LekaOS)
15 changes: 15 additions & 0 deletions app/os/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "rtos/ThisThread.h"
#include "rtos/Thread.h"

#include "ActivityKit.h"
#include "CoreBattery.h"
#include "CoreBufferedSerial.h"
#include "CoreDMA2D.hpp"
Expand All @@ -35,6 +36,7 @@
#include "CoreSTM32Hal.h"
#include "CoreTimeout.h"
#include "CoreVideo.hpp"
#include "DisplayTags.h"
#include "EventLoopKit.h"
#include "FATFileSystem.h"
#include "FirmwareKit.h"
Expand All @@ -47,6 +49,7 @@
#include "SerialNumberKit.h"
#include "SlicingBlockDevice.h"
#include "VideoKit.h"
#include "boost/sml.hpp"
#include "bootutil/bootutil.h"
#include "commands/LedFullCommand.h"
#include "commands/LedRangeCommand.h"
Expand Down Expand Up @@ -322,6 +325,16 @@ namespace mcuboot {

} // namespace mcuboot

namespace activities {

auto display_tag = leka::activity::DisplayTags(rfidkit, display::videokit);

inline const std::unordered_map<MagicCard, interface::Activity *> activities {{MagicCard::number_10, &display_tag}};

} // namespace activities

auto activitykit = ActivityKit {};

namespace robot {

namespace internal {
Expand All @@ -348,6 +361,7 @@ namespace robot {
behaviorkit,
commandkit,
rfidkit,
activitykit,
};

} // namespace robot
Expand Down Expand Up @@ -475,6 +489,7 @@ auto main() -> int
firmware::initializeFlash();

commandkit.registerCommand(command::list);
activitykit.registerActivities(activities::activities);

robot::controller.initializeComponents();
robot::controller.registerOnUpdateLoadedCallback(firmware::setPendingUpdate);
Expand Down

0 comments on commit 98b2a58

Please sign in to comment.