2 \author Travis Goodspeed
3 \brief These functions manage command interpretation.
10 unsigned char cmddata[CMDDATALEN];
11 unsigned char silent=0;
13 //! Transmit a string.
14 void txstring(unsigned char app,
17 unsigned long len=strlen(str);
23 /*! \brief Transmit a debug string.
25 Transmits a debugging string that is to be printed
26 out of line by the client. This is just for record-keeping;
27 it is not considered a proper reply to a query.
29 void debugstr(const char *str){
30 txstring(0xFF,0xFF,str);
34 //! Transmit a header.
35 void txhead(unsigned char app,
45 void txdata(unsigned char app,
53 serial_tx(cmddata[i]);
58 unsigned long rxlong(){
59 unsigned long toret=0;
61 toret|=(((long)serial_rx())<<8);
62 toret|=(((long)serial_rx())<<16);
63 toret|=(((long)serial_rx())<<24);
67 unsigned int rxword(){
68 unsigned long toret=0;
70 toret|=(((long)serial_rx())<<8);
74 void txlong(unsigned long l){
85 void txword(unsigned int l){
92 //Be very careful changing delay().
93 //It was chosen poorly by trial and error.
95 //! Delay for a count.
96 void delay(unsigned int count){
97 volatile unsigned int i=count;
98 while(i--) asm("nop");
101 void msdelay(unsigned int ms){
102 volatile unsigned int i,j;
106 while(j--) asm("nop");
108 //Using TimerA might be cleaner.