From: Nodir Qodirov <nodir.qodirov@gmail.com>
To: Christophe Coutand <ccoutand@stmi.com>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] eCos heartbeat function handler
Date: Tue, 21 Jul 2009 06:52:00 -0000 [thread overview]
Message-ID: <186ad4050907202351k2d2d30ffk70928e4046279cd6@mail.gmail.com> (raw)
In-Reply-To: <D6050C555CC56940A7AF326522830276021E7DD5@mail2.STMIRV01.COM>
Thank you Christophe! This is exactly the same which I was looking for!
After further analyze I got answer to several my questions, including
responsibility of Cyg_RealTimeClock class.
But there is one more question, where I'm having little difficulty.
That is: after h/w tick interrupt - first ISR of that interrupt then
DSR is called. And as you told:
> The tick value is incremented from the DSR:
>
> void Cyg_RealTimeClock::dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data)
> rtc->tick( count );
and in tick( cyg_uint32 ticks ) function there is loop
(\kernel\current\src\common\clock.cxx) :
while( ticks-- )
{
...
}
where *ticks* is the value provided by call from DSR. So, my confusion
is what is value of this *ticks* and why we need decrement it in
*while* loop?
There is comment in source code:
// Increment the counter in a loop so we process
// each tick separately. This is easier than trying
// to cope with a range of increments.
but, couldn't get any idea.
2009/7/19 Christophe Coutand <ccoutand@stmi.com>:
> I believe what you are looking for is located in:
>
> kernel\current\src\common\clock.cxx
>
> The clock is created here and attached to the HW interrupt:
>
> Cyg_RealTimeClock::Cyg_RealTimeClock()
> : Cyg_Clock(rtc_resolution),
> interrupt(CYGNUM_HAL_INTERRUPT_RTC,
> CYGNUM_KERNEL_COUNTERS_CLOCK_ISR_PRIORITY,
> (CYG_ADDRWORD)this, isr, dsr)
> {
> CYG_REPORT_FUNCTION();
> HAL_CLOCK_INITIALIZE( CYGNUM_KERNEL_COUNTERS_RTC_PERIOD);
> interrupt.attach();
> interrupt.unmask_interrupt(CYGNUM_HAL_INTERRUPT_RTC);
> Cyg_Clock::real_time_clock = this;
> }
>
> The tick value is incremented from the DSR:
>
> void Cyg_RealTimeClock::dsr(cyg_vector vector, cyg_ucount32 count, CYG_ADDRWORD data)
> rtc->tick( count );
>
> The period of the RTC clock is configurable from your .ecc file.
>
> Christophe
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2009-07-21 6:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-19 8:08 Nodir Qodirov
2009-07-19 8:18 ` Andrew Lunn
2009-07-19 14:07 ` Nodir Qodirov
2009-07-19 14:47 ` Christophe Coutand
2009-07-21 6:52 ` Nodir Qodirov [this message]
2009-07-21 7:27 ` Christophe Coutand
2009-08-05 11:22 ` Ormund Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=186ad4050907202351k2d2d30ffk70928e4046279cd6@mail.gmail.com \
--to=nodir.qodirov@gmail.com \
--cc=ccoutand@stmi.com \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).