ex1.c

来自「三星2410的一些DEMO小例程」· C语言 代码 · 共 91 行

C
91
字号
/**************************************************************************
*                                                                         *
*   PROJECT     : ARM port for UCOS-II                                    *
*                                                                         *
*   MODULE      : EX1.c                                                   *
*                                                                         *
*   AUTHOR      : Michael Anburaj                                         *
*                 URL  : http://geocities.com/michaelanburaj/             *
*                 EMAIL: michaelanburaj@hotmail.com                       *
*                                                                         *
*   PROCESSOR   : Any processor                                           *
*                                                                         *
*   IDE         : Any IDE                                                 *
*                                                                         *
*   DESCRIPTION :                                                         *
*   This is a sample code to test UCOS-II.                                *
*                                                                         *
**************************************************************************/

#include "def.h"
//#include "lcd.h"
//#include "lcdchar.h"
//#include "lcdlib.h"
//#include "glib.h"
#include "includes.h"
#include "consol.h"



/* ********************************************************************* */
/* Global definitions */


/* ********************************************************************* */
/* File local definitions */


#define	STACKSIZE	1024*10

unsigned int Stack1[STACKSIZE];
unsigned int Stack2[STACKSIZE];
unsigned int Stack3[STACKSIZE];
void user_task1(void *p);
void user_task2(void *p);

int zhl;
int zhl1;

void user_task1(void *i)
{
			
		while(1){
		//Uart_Printf("Hello!!\n");		
				
		OSTimeDly(2*OS_TICKS_PER_SEC);
	  }
}

void user_task2(void *i)
{
			
		while(1){
		Uart_Printf("enter user task2\n");		
				
		OSTimeDly(OS_TICKS_PER_SEC/3);
	  }
}

OS_EVENT *RandomSem;

//void lcddisp(void);

/* ********************************************************************* */
/* Global functions */


void APP_vMain (void)
{
	

	OSInit();  	 
	OSTimeSet(0); 
 OSTaskCreate(user_task1, (void *)0, (void *)&Stack2[STACKSIZE - 1], 23); 
 	FRMWRK_vStartTicker(OS_TICKS_PER_SEC);  // os_cfg.h 
  OSStart();	
                  
}



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?