public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] RedBoot: patch to improve net timekeeping.
@ 2001-01-22 15:11 Grant Edwards
  0 siblings, 0 replies; only message in thread
From: Grant Edwards @ 2001-01-22 15:11 UTC (permalink / raw)
  To: ecos-discuss

Here's a patch to net_io.c that changes the getc() routines
to call MS_TICKS() rather than CYGACC_CALL_IF_DELAY_US() when
waiting for input.

If a similar approach is used in the HAL's serial i/o routines,
it results in the system time being fairly accurate if the CPU
isn't heavily loaded.  As long as you call MS_TICKS() when
you're in a busy-idle loop, the accuracy of the system time is
determined by the CPU usage: 10% CPU means the clock is 10%
slow.  This should make it fairly useful for non-critical
interval timing.

NB: This changes the incremental wait in the net_io getc
    routines from 100us to 1ms.  If somebody really needs 100us
    wiats, a second delay routine could be added to ticks.c
    that delays for 100us and increments the "ticks" variable
    every 10th call.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-01-22 15:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-22 15:11 [ECOS] RedBoot: patch to improve net timekeeping Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).