-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo.cpp
47 lines (36 loc) · 1.01 KB
/
demo.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
#include "kronos.h"
using namespace kronos;
static void Start(void* data);
int main() {
// Task has to be created for Reliance Edge to be initialized properly
xTaskCreate(
Start,
"MAIN",
KS_COMPONENT_STACK_SIZE_LARGE,
nullptr,
KS_COMPONENT_PRIORITY_HIGH,
nullptr
);
// START FREERTOS
vTaskStartScheduler();
return 1;
}
static void Start(void* data) {
// INITIALIZE ATMEL DRIVERS
atmel_start_init();
// INITIALIZE FRAMEWORK
Framework::CreateInstance();
// INITIALIZE ALL DRIVERS
Framework::CreateDescriptor<KsUsart>(KS_DESC_UART_COMMS, &USART_UHF);
// ADD MODULES
Framework::AddModule<FileManagerModule>();
Framework::AddModule<SchedulerModule>();
Framework::AddModule<WorkerModule>();
Framework::AddModule<CommunicationHandlerModule>();
Framework::AddModule<ParamsModule>();
// INITIALIZE MODULES
Framework::InitModules();
// START FRAMEWORK
Framework::Start();
vTaskDelete(nullptr);
}