-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.cpp
49 lines (35 loc) · 959 Bytes
/
main.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
/*
* main.cpp
*
* Created on: 30 gru 2022
* Author: kwarc
*/
#include <memory>
#include <cassert>
#include <cstdio>
#include <hal/hal_system.hpp>
#include "cmsis_os2.h"
#include "app/view/lcd_view/lcd_view.hpp"
#include "app/view/console_view/console_view.hpp"
#include "app/model/effect_processor.hpp"
#include "app/controller/controller.hpp"
void init_thread(void *arg)
{
/* Create active objects */
auto model = std::make_unique<mfx::effect_processor>();
auto lcd_view = std::make_unique<mfx::lcd_view>();
auto ctrl = std::make_unique<mfx::controller>(std::move(model), std::move(lcd_view));
osThreadSuspend(osThreadGetId());
}
int main(void)
{
hal::system::init();
printf("System started\r\n");
osKernelInitialize();
osThreadNew(init_thread, NULL, NULL);
if (osKernelGetState() == osKernelReady)
osKernelStart();
assert(!"OS kernel start error");
while (1);
return 0;
}