#define CCREAD P5DIR&=~MISO
//! Set up the pins for CC mode. Does not init debugger.
-unsigned char ccsetup(){
+void ccsetup(){
P5OUT|=MOSI+SCK+RST;
P5DIR|=MOSI+SCK+RST;
//P5DIR&=~MISO; //MOSI is MISO
void cchandle(unsigned char app,
unsigned char verb,
unsigned char len){
- unsigned char i;
switch(verb){
//PEEK and POKE will come later.
case READ: //Write a command and return 1-byte reply.
break;
case START://enter debugger
ccdebuginit();
+ txdata(app,verb,0);
break;
case STOP://exit debugger
//Take RST low, then high.
P5OUT&=~RST;
CCDELAY(CCSPEED);
P5OUT|=RST;
+ txdata(app,verb,0);
break;
case SETUP:
ccsetup();
//Return the word.
toret=cmddata[1];
- toret=toret<<8+cmddata[1];
+ toret=(toret<<8)+cmddata[1];
return toret;
}