i was trying to compile the following arm coding ,which i recentlu bought rom embedded artists. it was unable to access the file "../pre_emptive_os/api/osapi.h".later i try to find the above file right from the root of linux-2.6.x . i tried man command also, i searched in net also , i could not find any clue for locating the above file.can any body assist me
#include "../pre_emptive_os/api/osapi.h"
#include "../pre_emptive_os/api/general.h"
#include <printf_P.h>
#include <ea_init.h>
#include <lpc2xxx.h>
#define PROC1_STACK_SIZE 600
#define INIT_STACK_SIZE 512
static tU8 proc1Stack[PROC1_STACK_SIZE];
static tU8 initStack[INIT_STACK_SIZE];
static tU8 pid1;
static void proc1(void* arg);
static void initProc(void* arg);
#define KEY_P2_24 0x01000000
#define KEY_P2_25 0x02000000
#define KEY_P2_26 0x04000000
#define KEY_P2_27 0x08000000
/*****************************************************************************
*
* Description:
* The first function to execute
*
****************************************************************************/
int
main(void)
{
tU8 error;
tU8 pid;
osInit();
osCreateProcess(initProc, initStack, INIT_STACK_SIZE, &pid, 1, NULL, &error);
osStartProcess(pid, &error);
osStart();
return 0;
}
/*****************************************************************************
*
* Description:
* A process entry function
*
* Params:
* [in] arg - This parameter is not used in this application.
*
****************************************************************************/
static void
proc1(void* arg)
{
tU8 dirRight = TRUE;
tU32 pattern;
tU32 sleepTime = 20;
//set P2.16-p2.23 to outputs
IODIR2 |= 0x00ff0000;
IOSET2 = 0x00ff0000;
//set P2.24-p2.27 to inputs
IODIR2 &= ~0x0f000000;
for(;
{
if (dirRight == TRUE)
pattern = 0x00010000;
else
pattern = 0x01000000;
while (((dirRight == TRUE) && (pattern < 0x01000000)) ||
((dirRight == FALSE) && (pattern > 0x00008000)))
{
IOCLR2 = pattern;
osSleep(sleepTime);
IOSET2 = pattern;
/*
* Update pattern
*/
if (dirRight == TRUE)
pattern <<= 1;
else
pattern >>= 1;
/*
* Check if any key has been pressed
*/
if ((IOPIN2 & KEY_P2_24) == 0)
dirRight = FALSE;
if ((IOPIN2 & KEY_P2_25) == 0)
sleepTime--;
if ((IOPIN2 & KEY_P2_26) == 0)
sleepTime++;
if ((IOPIN2 & KEY_P2_27) == 0)
dirRight = TRUE;
if (sleepTime < 2)
sleepTime = 2;
else if (sleepTime > 40)
sleepTime = 40;
}
}
}
/*****************************************************************************
*
* Description:
* The entry function for the initialization process.
*
* Params:
* [in] arg - This parameter is not used in this application.
*
****************************************************************************/
static void
initProc(void* arg)
{
tU8 error;
eaInit();
printf("\n***************************************************");
printf("\n* *");
printf("\n* Sample application that demonstrates *");
printf("\n* controlling the LEDs and reading the keys. *");
printf("\n* *");
printf("\n* Key P2.24 = run to the left *");
printf("\n* Key P2.25 = run faster *");
printf("\n* Key P2.26 = run slower *");
printf("\n* Key P2.27 = run to the right *");
printf("\n* *");
printf("\n* (C) Embedded Artists 2006 *");
printf("\n* *");
printf("\n***************************************************\n");
osCreateProcess(proc1, proc1Stack, PROC1_STACK_SIZE, &pid1, 3, NULL, &error);
osStartProcess(pid1, &error);
osDeleteProcess();
}
/*****************************************************************************
*
* Description:
* The timer tick entry function that is called once every timer tick
* interrupt in the RTOS. Observe that any processing in this
* function must be kept as short as possible since this function
* execute in interrupt context.
*
* Params:
* [in] elapsedTime - The number of elapsed milliseconds since last call.
*
****************************************************************************/
void
appTick(tU32 elapsedTime)
{
}