You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1019 B
C
36 lines
1019 B
C
/* 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 */
|
|
}
|