Keil™, An ARM® Company

µVision® User's Guide

twatch

Summary 
void twatch (
  unsigned long states);   /* clock states to delay */
Description 

The twatch debugger function is used in a debugger signal function to delay until the specified number of CPU states has elapsed. While this function delays, your target program continues to execute. This function is accurate even when used with devices that have slow clock or power-saving modes.

Note

  • The twatch debugger function may be called from within a signal function only. Calls to twatch from outside a signal function are not allowed and result in an error message.
Return Value None.
See Also swatch
Example 
signal void int0_signal (void) {
  while (1) {
    PORT3 |= 0x04;             /* pull INT0(P3.2) high */
    PORT3 &= ~0x04;            /* pull INT0(P3.2) low */
                               /*   and generate interrupt */
    PORT3 |= 0x04;             /* pull INT0(P3.2) high */
    twatch (CLOCK);            /* wait for 1 second */
  }
}

The following call starts the above signal function which toggles port 3.2 high, low, then high every one second.

> int0_signal ();