Keil™, An ARM® Company

µVision® User's Guide

swatch

Summary 
void swatch (
  float seconds);   /* seconds to delay */
Description 

The swatch debugger function is used in a debugger signal function to delay until the specified number of seconds 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 swatch debugger function may be called from within a signal function only. Calls to swatch from outside a signal function are not allowed and result in an error message.
Return Value None.
See Also twatch
Example 
signal void int0_signal (void) {
  while (1) {
    PORT3 |= 0x04;             /* pull PORT 3.2 high   */
    swatch (0.05);             /* wait 50 milliseconds */
    PORT3 &= ~0x04;            /* pull PORT 3.2 low    */
    swatch (0.05);             /* wait 50 milliseconds */
  }
}

The following call starts the above signal function which toggles port 3.2 every 50 milliseconds.

> int0_signal ();