X-Git-Url: http://git.rot13.org/?p=goodfet;a=blobdiff_plain;f=firmware%2Fapps%2Fradios%2Fccspi.c;h=377a5f0cbe4c2a66a6e1cbf8926ee271da9d00c5;hp=ff4661694f2020cc670101b097e20e77d1c1e7b2;hb=a031b4a563978102c664466d1e91a9c3ab0553dd;hpb=022d9128fe8a5783e3b804581fe7996d17095ef6 diff --git a/firmware/apps/radios/ccspi.c b/firmware/apps/radios/ccspi.c index ff46616..377a5f0 100644 --- a/firmware/apps/radios/ccspi.c +++ b/firmware/apps/radios/ccspi.c @@ -54,10 +54,14 @@ void ccspisetup(){ DIRCE; P4OUT|=BIT5; //activate CC2420 voltage regulator - P4OUT|=BIT6; //bring CC2420 out of reset + msdelay(100); + + //Reset the CC2420. + P4OUT&=~BIT6; + P4OUT|=BIT6; //Begin a new transaction. - CLRSS; + CLRSS; SETSS; } @@ -118,45 +122,59 @@ void ccspi_handle_fn( uint8_t const app, //debugstr("Chipcon SPI handler."); switch(verb){ + case PEEK: + cmddata[0]|=0x40; //Set the read bit. + //DO NOT BREAK HERE. case READ: case WRITE: + case POKE: CLRSS; //Drop !SS to begin transaction. for(i=0;i