Keil Logo


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

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.


  • 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


See Also


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 ();
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.