-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
35 lines (27 loc) · 1021 Bytes
/
main.c
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
/* TimeBomb/Button with uC/OS-II RTOS */
#include "uc_ao.h" /* uC/AO API */
#include "bsp.h"
#include "timebomb.h"
static char const this_module[] = "main"; /* this module name for Q_ASSERT() */
OS_STK stack_timeBomb[100]; /* task stack */
static Event *timeBomb_queue[10];
static TimeBomb timeBomb;
Active *AO_TimeBomb = &timeBomb.super;
/* the main function =========================================================*/
int main() {
INT8U err;
BSP_init(); /* initialize the BSP */
OSInit(); /* initialize uC/OS-II */
/* create AO and start it */
TimeBomb_ctor(&timeBomb);
Active_start(AO_TimeBomb,
2U,
timeBomb_queue,
sizeof(timeBomb_queue) / sizeof(timeBomb_queue[0]),
stack_timeBomb,
sizeof(stack_timeBomb),
0U);
BSP_start(); /* configure and start the interrupts */
OSStart(); /* start the uC/OS-II scheduler... */
return 0; /* NOTE: the scheduler does NOT return */
}