User interface – Comtrol eCos User Manual

Page 813

Advertising
background image

Synthetic Target Watchdog Device

only a short amount of time so their effects can be ignored. If the application makes direct system calls such as

cyg_hal_sys_read

then the system behaviour becomes undefined. In addition by default the idle thread will make

blocking

select

system calls, effectively waiting until an interrupt occurs. If an application spends much of its

time idle then the watchdog device may take much longer to trigger than expected. It may be desirable to enable
the synthetic target HAL configuration option

CYGIMP_HAL_IDLE_THREAD_SPIN

, causing the idle thread to spin

rather than block, at the cost of wasted cpu cycles.

The default is to use consumed cpu time, but this can be changed in the target definition file:

synth_device watchdog {

use wallclock_time

...

}

User Interface

When the synthetic target is run in graphical mode the watchdog device extends the user interface in two ways. The

Help

menu is extended with an entry for the watchdog-specific documentation. There is also a graphical display of

the current state of the watchdog. Initially the watchdog is asleep:

When application code starts the device the watchdog will begin to keep an eye on things (or occasionally both
eyes).

If the watchdog triggers the display will change again, and optionally the user can receive an audible alert. The
location of the watchdog display within the I/O auxiliary’s window can be controlled via a watchdog_pack entry
in the target definition file. For example the following can be used to put the watchdog display to the right of the
central text window:

synth_device watchdog {

watchdog_pack -in .main.e -side top

...

}

The user interface section of the generic synthetic target HAL documentation can be consulted for more information
on window packing.

709

Advertising