Keil Logo

wwatch

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

The debug function wwatch can be used in a debugger signal function to supervise the specified address until it is written. The target program continues to execute. This function is useful when creating signal functions that simulate external hardware.

The function returns after a write access occurred on address, allowing the signal function to read the written value and modify the content of the 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 function can 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);
  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.