+ #endif
+}
+//! Set glitching rate.
+void glitchrate(u16 rate){
+ glitchcount=rate;
+}
+
+//! Handles a monitor command.
+void glitchhandle(unsigned char app,
+ unsigned char verb,
+ unsigned long len){
+ switch(verb){
+ case GLITCHVOLTAGES:
+ glitchvoltages(cmddataword[0],
+ cmddataword[1]);
+ txdata(app,verb,0);
+ break;
+ case GLITCHRATE:
+ glitchrate(cmddataword[0]);
+ txdata(app,verb,0);
+ break;
+ case GLITCHVERB:
+ //FIXME parameters don't work yet.
+ glitchprime();
+ handle(cmddata[0],cmddata[1],0);
+ break;
+ case GLITCHTIME:
+ _DINT();//disable interrupts
+ TACTL=0; //clear dividers
+ TACTL|=TACLR; //clear config
+ TACTL|=TASSEL_SMCLK| //smclk source
+ MC_2; //continuout mode.
+
+ //perform the function
+ silent++;//Don't want the function to return anything.
+ handle(cmddata[0],cmddata[1],0);
+ silent--;
+ cmddataword[0]=TAR; //Return counter.
+ txdata(app,verb,2);
+ break;
+ case START:
+ case STOP:
+ case GLITCHAPP:
+ default:
+ debugstr("Unknown glitching verb.");
+ txdata(app,NOK,0);
+ }