comparison core/client.cpp @ 45:579c86316008 newapi

Major API overhaul. Moved to a single data structure for handling render functions. Functionally, generally similar except for scheduling within PRU loop function, which now uses interrupts from the PRU rather than polling. This requires an updated kernel.
author andrewm
date Thu, 28 May 2015 14:35:55 -0400
parents 12ee9a61e81d
children f3251851c718
comparison
equal deleted inserted replaced
40:419ce4ebfc4c 45:579c86316008
95 if (n < 0){ 95 if (n < 0){
96 rt_fprintf(stderr,"Error while receiving"); 96 rt_fprintf(stderr,"Error while receiving");
97 return -1; 97 return -1;
98 } 98 }
99 printf("Received a datagram: "); 99 printf("Received a datagram: ");
100 printf(inBuffer); 100 printf("%s", inBuffer);
101 //the worst parser ever 101 //the worst parser ever
102 int previousN=0; 102 int previousN=0;
103 int currentVariable=0; 103 int currentVariable=0;
104 for(int n=0; inBuffer[n]!=0 && currentVariable<message.numVariables && n-previousN<MAX_VAR_STRING && n<BUFF_LEN; n++){ //scan the string 104 for(int n=0; inBuffer[n]!=0 && currentVariable<message.numVariables && n-previousN<MAX_VAR_STRING && n<BUFF_LEN; n++){ //scan the string
105 if(inBuffer[n]==';'||inBuffer[n]==0||inBuffer[n]=='\n'){ // if you find a separator or you are at the end of the string, parse the variable 105 if(inBuffer[n]==';'||inBuffer[n]==0||inBuffer[n]=='\n'){ // if you find a separator or you are at the end of the string, parse the variable