Vasili Goutas wrote:
>
> Paolo Mantegazza wrote:
Please be careful, what's below are not my words but yours.
> I'm not sure if I understand who the periodic mode runs.
> First I have to declare that the specified task will run periodicaly
> with a period of ns or units, depending which function is called.
> Then the task runs until a call of rt_task_wait_period().
> This period is the one defined in the m,ake_period call.
> If start_rt_timer() has never been called, the task will never resumed ?
> Does start_rt_timer( period ) defines the same period as in the
> make_periodic call ?
1) - set the timer mode
2) - start the real time timer
3) do all the rest
The period you use for a task has nothing to do with the timer period.
Clearly if the timer is in periodic mode you cannot run a task with a
period that is less than that of the timer. in periodic mode the period
of the timer gives you the smaller time resolution you can use.
> > When you do rt_set_periodic you stop any running timer. The sequence is:
> > rt_set_whatever_mode();
> > start_rt_timer(....);
> In the examples directory in the stress module I found following
> #define ONE_SHOT
> ...
> #ifdef ONE_SHOT
> rt_set_oneshot_mode();
> #endif
> period = start_rt_timer(nano2count(TICK_TIME));
> expected = start = rt_get_time() + 10*period;
> rt_task_make_periodic(&thread, start, period);
> ...
> Why is here first set the oneshot mode?
> Also the manual for rt_set_oneshot_mode says that before each
> start_rt_timer call rt_set_oneshot_mode should be called.
So what's wrong above? Have I read it correctly or do I need a pair of
glasses?
The answer is also below where it is said the periodic mode is the
default. So clearly if you want it oneshot you must specifically ask for
it.
> > Beside the fact that it does not make sense to set the timer mode after
> > having starting the timer, you must not do that in tasks but at the
> > initting of your module. Note also that the periodic mode is the the
> > default one and need not to be set, if you never used oneshot before.
Ciao, Paolo.
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/