LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2008, 01:27 AM   #1
jeya
LQ Newbie
 
Registered: Dec 2008
Posts: 5

Rep: Reputation: 0
Thumbs up where is ../pre_emptive_os/api/osapi.h


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)
{
}

Last edited by jeya; 12-19-2008 at 01:30 AM. Reason: for updation and clarity
 
Old 12-19-2008, 01:38 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
The leading ".." means "go up one level". So if the command was executed from /home/user/dev/code then ../foo/bar.so is actually /home/user/dev/foo/bar.so
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rpm c++ api alrawab Programming 2 12-06-2007 07:07 AM
what is API ? nesta Programming 7 01-15-2007 08:01 PM
Pthreads API kamransoomro84 Programming 5 07-25-2006 12:19 PM
api vishalkhandade Linux - Software 1 04-26-2006 11:54 PM
Socket API shy Programming 2 10-23-2004 01:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration