2 \author Travis Goodspeed
3 \brief PS2 Timing Monitor for GoodFET
5 This module spies on PS/2. For now, it just reports the
6 inter-character timing information.
17 // Timer A0 interrupt service routine
18 interrupt(TIMERA0_VECTOR) Timer_A (void)
32 // This is just a plugin for now.
33 #define ps2handle pluginhandle
36 //! Handles a monitor command.
37 int ps2handle(unsigned char app,
43 WDTCTL = WDTPW + WDTHOLD; // Stop WDT
44 TACTL = TASSEL1 + TACLR; // SMCLK, clear TAR
45 CCTL0 = CCIE; // CCR0 interrupt enabled
46 CCR0 = 0x100; //clock divider
48 _EINT(); // Enable interrupts
51 P5DIR&=~(TDI+TDO);//input mode
54 debugstr("Waiting for a keypress.");
55 //Wait for a keypress.
58 //Debounce the 1s polling
59 while((P5IN&TDI && P5IN&TDO))
60 while((P5IN&TDI));// && P5IN&TDO));
62 //Transmit the data only if it is new.
63 if((clock-oldclock)>0x100){
64 cmddatalong[0]=clock;//-oldclock;
65 cmddatalong[0]-=oldclock;
74 debugstr("Unknown ps2 verb.");