This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Adding to main timer interrupt
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: "Paul D. DeRocco" <pderocco at ix dot netcom dot com>
- Cc: "'eCos Discuss'" <ecos-discuss at ecos dot sourceware dot org>
- Date: 10 Jan 2007 09:45:08 +0000
- Subject: Re: [ECOS] Adding to main timer interrupt
- References: <152901c73487$f25e3cc0$8d7ba8c0@PAULD>
"Paul D. DeRocco" <pderocco@ix.netcom.com> writes:
> Is there any standard way to add code to the main clock DSR, at the same
> level as its call to cyg_counter_tick (wherever that might be)? If there's
> no standard mechanism, what would be the least intrusive place to hack the
> existing code to do this, hopefully not in the HAL somewhere?
>
> What I need to do is add some code that calls cyg_counter_tick on a second
> clock, but at some rate which is a fraction of the fixed main clock rate, in
> order to implement a variable-rate clock. Also, I have certain other
> hardware processes that look like they'd be most efficiently dealt with by
> inserting a very small amount of polling code in the clock interrupt, rather
> than relying upon yet another hardware interrupt.
The simplest approach would be to install an alarm with an interval of
the rate that you want and just tick the second clock from its action
routine. For polling from the clock DSR, just use an alarm with an
interval of 1 so it is called every time.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
http://www.ecoscentric.com/legal Legal info, address and number
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss