-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
84 lines (66 loc) · 1.97 KB
/
main.cpp
File metadata and controls
84 lines (66 loc) · 1.97 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/****************************************************************************************
* ALI SAHBAZ
*
*
* ASOS - "Ali Sahbaz Operating System" Framework
*
*
* Date : 06.07.2023
* By : Ali Sahbaz
* e-mail : ali_sahbaz@outlook.com
*/
#include "asos_root/asos.h"
#include "asos_root/test_apps/asos_blinky_test.h"
#include "asos_root/test_apps/asos_cmd_rsp_test.h"
#include "asos_root/test_apps/asos_sm_test.h"
#include "asos_root/test_apps/asos_usb_rr_test.h"
/** OS HANDLER **/
static asos_object_t ASOS;
static blinky_obj_t blink_app;
static cmd_rsp_t cmd_app;
static sm_t sm_app;
static usb_t usb_app;
static void systic_callback_mocking() // 1 ms
{
asos_timer_process_run( &ASOS );
}
int main(int argc, char *argv[])
{
/*
QCoreApplication a(argc, argv);
QTimer timer;
QObject::connect(&timer, &QTimer::timeout, &systic_callback_mocking);
timer.start(1);
*/
asos_create(&ASOS,
5, /** CONTEXT SWITCH MS **/
1000); /** SYSTICK US **/
// You can load your hardware RTE layer and connect ASOS here
asos_app_create(&ASOS ,
&blink_app,
&blinky_create,
&blinky_delete,
&blinky_task,
ASOS_TASK_PRIO_4);
asos_app_create(&ASOS ,
&cmd_app,
&cmd_rsp_create,
NULL,
&cmd_rsp_process,
ASOS_TASK_PRIO_3);
asos_app_create(&ASOS ,
&sm_app,
&sm_create,
NULL,
&sm_process,
ASOS_TASK_PRIO_2);
asos_app_create(&ASOS ,
&usb_app,
&usb_create,
NULL,
&usb_process,
ASOS_TASK_PRIO_1);
asos_debug_mode_on(&ASOS);
asos_app_process_run( &ASOS );
return 0;
}