[ECOS] Watchdog Device

Jonathan Larmour jlarmour@redhat.com
Mon May 14 10:54:00 GMT 2001


"Pamulapati, Indrasena (CTS)" wrote:
> 
> Hi,
> 
> I have a doubt regarding the use of the watchdog device.
> 
> Can I program a watchdog device to interrupt my application after a
> particular delay i.e., can I use the Watchdog device as a delay mechanism
> instead of using the "delay" system clock provided by the OS.
> 
> The reason for this is, I need a particular application of mine to go to the
> " wait " state for a time that is lower than the tick value I am using. And
> I dont want to reduce the value of the system tick. For example, if I am
> using a tick value of 10millisec I can make my application sleep for only an
> integral multiple of 10millisec. But I want my application to sleep for a
> time less than 10millisec, say for 10microsec.
> In this case I can not use the " delay " system call provided by eCos
> because it takes a parameter only in terms of ticks.

You can only interface with the watchdog support with C++. See
io/watchdog/VERSION/include/watchdog.hxx. You need to instantiate a
Cyg_Watchdog_Action object, and then install it.

But will your watchdog have any finer granularity than that? If this is a
PC, have you written your own hardware watchdog driver for some watchdog
hardware on your board? Because eCos doesn't have any for x86, and just
emulates it with the system clock.

An alternative (admittedly undocumented) feature is:

#include <cyg/hal/hal_if.h>
CYGACC_CALL_IF_DELAY_US(usec);

which delays for usec microseconds. Also enable
CYGSEM_HAL_VIRTUAL_VECTOR_CLAIM_DELAY_US in your eCos configuration.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine



More information about the Ecos-discuss mailing list