generated from Forairaaaaa/LGFX_Simulator_SDL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrachel.cpp
executable file
·66 lines (52 loc) · 1.07 KB
/
rachel.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/**
* @file rachel.cpp
* @author Forairaaaaa
* @brief
* @version 0.1
* @date 2023-11-04
*
* @copyright Copyright (c) 2023
*
*/
#include "rachel.h"
#include <mooncake.h>
#include "hal/hal.h"
#ifndef ESP_PLATFORM
#include "hal/hal_simulator/hal_simulator.hpp"
#else
#include "hal/hal_rachel/hal_rachel.h"
#endif
#include "apps/apps.h"
using namespace MOONCAKE;
static Mooncake* _mooncake = nullptr;
void RACHEL::Setup()
{
spdlog::info("Rachel Setup");
// HAL injection
#ifndef ESP_PLATFORM
HAL::Inject(new HAL_Simulator);
#else
HAL::Inject(new HAL_Rachel);
#endif
// Mooncake framework
_mooncake = new Mooncake;
_mooncake->init();
// Install launcher
auto launcher = new APPS::Launcher_Packer;
_mooncake->installApp(launcher);
// Install apps
rachel_app_install_callback(_mooncake);
// Create launcher
_mooncake->createApp(launcher);
}
void RACHEL::Loop()
{
_mooncake->update();
}
void RACHEL::Destroy()
{
// Free
delete _mooncake;
HAL::Destroy();
spdlog::warn("Rachel destroy");
}