Download performance evaluation of embedded linux on
Transcript
{
if(m[n-1]==0)
sOp[5-n]='0';
if(m[n-1]==1)
sOp[5-n]='1';
if(m[n-1]==2)
sOp[5-n]='2';
if(m[n-1]==3)
sOp[5-n]='3';
if(m[n-1]==4)
sOp[5-n]='4';
if(m[n-1]==5)
sOp[5-n]='5';
if(m[n-1]==6)
sOp[5-n]='6';
if(m[n-1]==7)
sOp[5-n]='7';
if(m[n-1]==8)
sOp[5-n]='8';
if(m[n-1]==9)
sOp[5-n]='9';
}
if(l<0)
sOp[0]='-';
else
sOp[0]='+';
if (!writeport(fd,sOp,p)) {
printf("write failed\n");
close(fd);
return 1;
}
/*This provides synchronization in communication between ARM
processor
and Inverted Pendulum model(implemented in Atmega 8535)*/
for(i=0;i<5;i++)
{
}
return 0;
}
/************** Protocol implementation of Read *************************/
int read_ser(char *sResult)
{
/*The Protocol for reading data from the serial port is
1.Wait for an array of 7 characters
2.The 1st three digits will indicate 'theta'
3.The last 4 characters will indicate 'deri_theta'
*/
int i;
int p;
63