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);
33 //! Transmit a header.
34 void txhead(unsigned char app,
44 void txdata(unsigned char app,
52 serial_tx(cmddata[i]);
57 unsigned long rxlong(){
58 unsigned long toret=0;
60 toret|=(((long)serial_rx())<<8);
61 toret|=(((long)serial_rx())<<16);
62 toret|=(((long)serial_rx())<<24);
66 unsigned int rxword(){
67 unsigned long toret=0;
69 toret|=(((long)serial_rx())<<8);
73 void txlong(unsigned long l){
84 void txword(unsigned int l){
91 //Be very careful changing delay().
92 //It was chosen poorly by trial and error.
94 //! Delay for a count.
95 void delay(unsigned int count){
96 volatile unsigned int i=count;
97 while(i--) asm("nop");
100 void msdelay(unsigned int ms){
101 volatile unsigned int i,j;
105 while(j--) asm("nop");
107 //Using TimerA might be cleaner.