Keil™, An ARM® Company

µVision® User's Guide

wwatch

Summary 
void wwatch (
  unsigned long address);   /* address to watch */
Description 

The wwatch debugger function used in a debugger signal function to delay until the specified address is written. While this function is delays, your target program continues to execute. This function is useful when creating signal functions that simulate external hardware.

The wwatch debugger function returns after address is actually written to by your target program. This allows your signal function to read the written value and modify the contents of memory if required.

Note

  • If address refers to a Special Function Register (SFR) or Peripheral Register repetitive writes may occur which your signal function must be prepared to ignore.
  • The wwatch debugger function may be called from within a signal function only. Calls to wwatch from outside a signal function are not allowed and result in an error message.
Return Value None.
See Also rwatch
Example 
signal void write_message (unsigned long adr) {
  float sec;
  unsigned char val;

  printf ("Track write accesses to address 0x%X\n", adr);

  while (1) {
    wwatch (adr);                        // wait for write access
    val = _RBYTE (adr);                  // read value
    sec = ((float) states) / clock;      // calculate time stamp
    printf ("Write 0x%X to 0x%X at %f Sec.\n", val, adr, sec);
  }
}

The following call starts the above signal function which outputs a message (using the printf debugger function) for each access to PORT1.

> write_message (&PORT1);