This is the mail archive of the c++-embedded@sourceware.cygnus.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: timer idioms in embedded system (fwd)


Forwarded message:
>From fwmiller Fri Jun 26 10:29 EDT 1998
From: fwmiller (Frank W. Miller)
Message-Id: <199806261429.KAA20375@yangtze.cs.umd.edu>
Subject: Re: timer idioms in embedded system
To: shiva@well.com
Date: Fri, 26 Jun 1998 10:29:36 -0400 (EDT)
Cc: fwmiller (Frank W. Miller)
In-Reply-To: <35931852.1509@compuserve.com> from "Ken" at Jun 25, 98 08:41:06 pm
X-Mailer: ELM [version 2.4 PL25]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Content-Length: 929

> I'd like to change this to use a single counter incremented by the
> interrupt. Client code would wait for the counter to increment to a
> desired value. Example wait code might be
> 

You might want to look at the timer management for TCP in XINU.
They keep a list of timeouts.  All but the first are deltas so
the first element is the only one decremented on an interrupt.
Check Comer's ``Internetworking with TCP/IP: Vol 2''.


> How should I handle rollover? I expect the counter to be 32-bit, and the
> interrupt tick to be 1 millisecond. The rollover should occur about
> every 46 days.
> 

I use a daemon that pops up every so often, once a day or once a week,
and resets the counter.

Later,
FM


--
Frank W. Miller                           Department of Computer Science
fwmiller@cs.umd.edu                               University of Maryland
http://www.cs.umd.edu/~fwmiller             College Park, Maryland 20742



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]