www.pudn.com > FULL_TI-MSP430-FOR-uCOS-II-V252.rar > TEST.C


/* 
********************************************************************************************************* 
*                                                uC/OS-II 
*                                          The Real-Time Kernel 
* 
*                              (c) Copyright 2002, Micrium, Inc., Weston, FL 
*                                           All Rights Reserved 
* 
*                                                TI MSP430 
********************************************************************************************************* 
*/ 
 
#include "includes.h" 
 
/* 
********************************************************************************************************* 
*                                               CONSTANTS 
********************************************************************************************************* 
*/ 
 
#define  TASK_STK_SIZE                  64       /* Size of each task's stacks (# of OS_STK entries)   */ 
 
/* 
********************************************************************************************************* 
*                                               VARIABLES 
********************************************************************************************************* 
*/ 
 
OS_STK   TaskStartStk[TASK_STK_SIZE]; 
 
/* 
********************************************************************************************************* 
*                                           FUNCTION PROTOTYPES 
********************************************************************************************************* 
*/ 
 
void   TaskStart(void *data);                    /* Function prototypes of Startup task                */ 
 
/*$PAGE*/ 
/* 
********************************************************************************************************* 
*                                                MAIN 
********************************************************************************************************* 
*/ 
 
void  main (void) 
{ 
    WDTCTL = WDTPW + WDTHOLD; 
 
    OSInit();                                              /* Initialize uC/OS-II                      */ 
    OSTaskCreate(TaskStart, (void *)0, &TaskStartStk[TASK_STK_SIZE - 1], 0); 
    OSStart();                                             /* Start multitasking                       */ 
} 
 
/* 
********************************************************************************************************* 
*                                            STARTUP TASK 
********************************************************************************************************* 
*/ 
 
void  TaskStart (void *pdata) 
{ 
    pdata  = pdata;                                        /* Prevent compiler warning                 */ 
 
    WDTCTL = WDT_MDLY_32;                                  /* Set time tick 32 mS                      */ 
    IE1   |= 0x01;                                         /* Enable Watchdog timer interrupts         */ 
 
    /* Application specific initialization */ 
 
    while (1) { 
        /* Task specific code */ 
 
        OSTimeDly(1);    
    } 
}