This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Change system tick during runtime


"Daniel Lidsten" <Daniel.Lidsten@combitechsystems.com> writes:

> In my system i want to run a thread at regular intervals since it is a
> control thread. It can be every 1ms but also every 50ms. Since i have to
> run the thread faster then i can setup an alarm in the default
> configuration where 10ms is the tick rate then i thought that perhaps i
> could let the system generate ticks more often. This is why i altered
> the tick generator.

To do this you would still only need to run the system clock at
1000Hz, not the 10000Hz you mentioned before. 1000Hz should be
doable on all but the slowest targets. You need to change the period
and denominator in the HAL to do this. On some targets the period is
calculated from the denominator, so you only need change the one
value. I added a new section to the HAL documentation a few weeks ago
describing how to do this.

To make the thread run at different rates at different times you
should then just change the trigger/interval times of the alarm, not
the frequency of the interrupts.

All time in eCos is based on the clock interrupt frequency, so
changing it would upset other alarms, network timeouts and the
system's notion of the passage of real time. It is not a good idea to
do this.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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