Keil™, An ARM® Company

µVision® User's Guide

rwatch

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

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

The rwatch debugger function returns before address is actually read by your target program. This allows your signal function to interrupt the read request and modify the contents of memory before it is actually read.

Note

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

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

  while (1) {
    rwatch (adr);
    val = getint ("Input Value for Read Trigger");
    _WBYTE (adr, val);       //  update value
  }
}

The following call starts the above signal function which prompts for a value each time var is read.

> read_trigger (&var);