本帖最后由 banhushui 于 2009-8-23 22:22 编辑
__task void Led1(void)
{uint32 i;
for(i=0; i<5; i++)
{
PC8=0; PC9=0; PC10=0; PC11=0;
os_dly_wait(100/OS_TIME);//100ms
PC8=1; PC9=1; PC10=1; PC11=1;
os_dly_wait(300/OS_TIME);//100ms
}
while(1)
{
PC8=0;
os_dly_wait(100/OS_TIME);//100ms
PC8=1;
os_dly_wait(100/OS_TIME);//100ms
PC9=0;
os_dly_wait(100/OS_TIME);//100ms
PC9=1;
os_dly_wait(100/OS_TIME);//100ms
PC10=0;
os_dly_wait(100/OS_TIME);//100ms
PC10=1;
os_dly_wait(100/OS_TIME);//100ms
PC11=0;
os_dly_wait(100/OS_TIME);//100ms
PC11=1;
os_dly_wait(100/OS_TIME);//100ms
}
}
__task void init (void)
{
os_tsk_create(Led1, 0);
os_tsk_delete_self ();
}
/*******************************************************************************
* Function Name : main
* Description : Main program.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
int main(void)
{//uint8 i=0;
#ifdef DEBUG
debug();
#endif
//ReStart:
/* System Clocks Configuration */
RCC_Configuration();
GPIO_Configuration();
/* NVIC configuration */
NVIC_Configuration();
//非RTOS调用该函数
//SysTick_Init();
os_sys_init (init);
} |