Skip to content

Commit 5a50800

Browse files
hartmannathanxiaoxiang781216
authored andcommitted
Documentation: Minor fixes in Tickless OS documentation
* Documentation/reference/os/time_clock.rst: Add missing Kconfig code-block, found at CWIKI [1]. Fix some typos. References: [1] https://cwiki.apache.org/confluence/display/NUTTX/Tickless+OS
1 parent 6d11fe3 commit 5a50800

File tree

1 file changed

+37
-32
lines changed

1 file changed

+37
-32
lines changed

Documentation/reference/os/time_clock.rst

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ are, in increasing order of importance:
209209

210210
- **Overhead**: Although the CPU usage of the system timer
211211
interrupt at 100Hz is really very low, it is still mostly
212-
wasted processing time. One most timer interrupts, there is
213-
really nothing that needs be done other than incrementing the
212+
wasted processing time. On most timer interrupts, there is
213+
really nothing that needs to be done other than incrementing the
214214
counter.
215215
- **Resolution**: Resolution of all system timing is also
216-
determined by ``CONFIG_USEC_PER_TICK``. So nothing that be time
217-
with resolution finer than 10 milliseconds be default. To
218-
increase this resolution, ``CONFIG_USEC_PER_TICK`` an be
216+
determined by ``CONFIG_USEC_PER_TICK``. So nothing can be timed
217+
with resolution finer than 10 milliseconds by default. To
218+
increase this resolution, ``CONFIG_USEC_PER_TICK`` can be
219219
reduced. However, then the system timer interrupts use more of
220220
the CPU bandwidth processing useless interrupts.
221221
- **Power Usage**: But the biggest issue is power usage. When the
@@ -226,7 +226,7 @@ are, in increasing order of importance:
226226
greater power consumption.
227227

228228
**Tickless OS**. The so-called *Tickless OS* provides one solution
229-
to issue. The basic concept here is that the periodic, timer
229+
to this issue. The basic concept here is that the periodic, timer
230230
interrupt is eliminated and replaced with a one-shot, interval
231231
timer. It becomes event driven instead of polled: The default
232232
system timer is a polled design. On each interrupt, the NuttX
@@ -255,18 +255,26 @@ Tickless Configuration Options
255255

256256
- ``CONFIG_ARCH_HAVE_TICKLESS``: If the platform provides
257257
support for the *Tickless OS*, then this setting should be
258-
selected in the ``Kconfig`` file for the board. Here is what
259-
the selection looks in the ``arch/Kconfig`` file for the
258+
selected in the ``Kconfig`` file for the architecture. Here is
259+
what the selection looks in the ``arch/Kconfig`` file for the
260260
simulated platform:
261261

262+
.. code-block:: console
263+
264+
config ARCH_SIM
265+
bool "Simulation"
266+
select ARCH_HAVE_TICKLESS
267+
---help---
268+
Linux/Cywgin user-mode simulation.
269+
262270
When the simulation platform is selected,
263271
``ARCH_HAVE_TICKLESS`` is automatically selected, informing the
264272
configuration system that *Tickless OS* options can be
265273
selected.
266274

267-
- ``CONFIG_SCHED_TICKLESS``: If ``CONFIG_ARCH_HAVE_TICKLESS``
268-
is selected, then it will enable the Tickless OS features in
269-
NuttX.
275+
- ``CONFIG_SCHED_TICKLESS``: If ``CONFIG_ARCH_HAVE_TICKLESS`` is
276+
selected, then you will be able to use this option to enable the
277+
*Tickless OS* features in NuttX.
270278

271279
- ``CONFIG_SCHED_TICKLESS_ALARM``: The tickless option can be
272280
supported either via a simple interval timer (plus elapsed
@@ -277,15 +285,15 @@ Tickless Configuration Options
277285

278286
The advantage of an alarm is that it avoids some small timing
279287
errors; the advantage of the use of the interval timer is that
280-
the hardware requirement may be less.
288+
the hardware requirement may be simpler.
281289

282290
- ``CONFIG_USEC_PER_TICK``: This option is not unique to
283291
*Tickless OS* operation, but changes its relevance when the
284-
*Tickless OS* is selected. In the default configuration where
292+
*Tickless OS* is selected. In the default configuration, where
285293
system time is provided by a periodic timer interrupt, the
286-
default system timer is configure the timer for 100Hz or
294+
default system timer is configured for 100Hz, that is,
287295
``CONFIG_USEC_PER_TICK=10000``. If ``CONFIG_SCHED_TICKLESS`` is
288-
selected, then there are no system timer interrupt. In this
296+
selected, then there are no system timer interrupts. In this
289297
case, ``CONFIG_USEC_PER_TICK`` does not control any timer
290298
rates. Rather, it only determines the resolution of time
291299
reported by ``clock_systime_ticks()`` and the resolution of
@@ -342,26 +350,23 @@ platform code must provide the following verify similar functions:
342350
- ``up_timer_start()``: Starts (or re-starts)
343351
the interval timer.
344352

345-
Note that a platform-specific implementation would probably
346-
require two hardware timers: (1) A interval timer to satisfy the
347-
requirements of ``up_timer_start()`` and
348-
``up_timer_cancel()``, and a (2) a counter to
349-
handle the requirement of
350-
``up_timer_gettime()``. Ideally, both timers
353+
Note that a platform-specific implementation would probably require two
354+
hardware timers: (1) A interval timer to satisfy the requirements of
355+
``up_timer_start()`` and ``up_timer_cancel()``, and (2) a counter to
356+
handle the requirement of ``up_timer_gettime()``. Ideally, both timers
351357
would run at the rate determined by ``CONFIG_USEC_PER_TICK`` (and
352358
certainly never slower than that rate).
353359

354-
Since timers are a limited resource, the use of two timers could
355-
be an issue on some systems. The job could be done with a single
356-
timer if, for example, the single timer were kept in a
357-
free-running at all times. Some timer/counters have the capability
358-
to generate a compare interrupt when the timer matches a
359-
comparison value but also to continue counting without stopping.
360-
If your hardware supports such counters, one might used the
361-
``CONFIG_SCHED_TICKLESS_ALARM`` option and be able to simply set
362-
the comparison count at the value of the free running timer *PLUS*
363-
the desired delay. Then you could have both with a single timer:
364-
An alarm and a free-running counter with the same timer!
360+
Since timers are a limited resource, the use of two timers could be an
361+
issue on some systems. The job could be done with a single timer if, for
362+
example, the single timer were kept in a free-running mode at all times.
363+
Some timer/counters have the capability to generate a compare interrupt
364+
when the timer matches a comparison value but also to continue counting
365+
without stopping. If your hardware supports such counters, one might use
366+
the ``CONFIG_SCHED_TICKLESS_ALARM`` option and be able to simply set the
367+
comparison count at the value of the free running timer *PLUS* the
368+
desired delay. Then you could have both with a single timer: An alarm
369+
and a free-running counter with the same timer!
365370

366371
In addition to these imported interfaces, the RTOS will export the
367372
following interfaces for use by the platform-specific interval

0 commit comments

Comments
 (0)