More reliably chipcon.
[goodfet] / firmware / apps / chipcon / chipcon.c
index 7b55db8..bbc751a 100644 (file)
@@ -36,7 +36,7 @@
 
 //This could be more accurate.
 //Does it ever need to be?
-#define CCSPEED 0
+#define CCSPEED 3
 #define CCDELAY(x) delay(x)
 
 #define SETMOSI P5OUT|=MOSI
@@ -124,7 +124,7 @@ void ccread(unsigned char len){
 //! Handles a monitor command.
 void cchandle(unsigned char app,
               unsigned char verb,
-              unsigned char len){
+              unsigned long len){
   switch(verb){
     //CC_PEEK and CC_POKE will come later.
   case READ:  //Write a command and return 1-byte reply.
@@ -331,6 +331,11 @@ unsigned char cc_debug(unsigned char len,
              unsigned char c){
   unsigned char cmd=0x54+(len&0x3);//(len&0x3);
   CCWRITE;
+  cctrans8(0xFF);//resync
+  cctrans8(0xFF);//resync
+  cctrans8(0xFF);//resync
+  cctrans8(0xFF);//resync
+  cctrans8(0xFF);//resync
   cctrans8(cmd);
   if(len--)
     cctrans8(a);