@@ -209,13 +209,13 @@ are, in increasing order of importance:
209
209
210
210
- **Overhead **: Although the CPU usage of the system timer
211
211
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
214
214
counter.
215
215
- **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
219
219
reduced. However, then the system timer interrupts use more of
220
220
the CPU bandwidth processing useless interrupts.
221
221
- **Power Usage **: But the biggest issue is power usage. When the
@@ -226,7 +226,7 @@ are, in increasing order of importance:
226
226
greater power consumption.
227
227
228
228
**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
230
230
interrupt is eliminated and replaced with a one-shot, interval
231
231
timer. It becomes event driven instead of polled: The default
232
232
system timer is a polled design. On each interrupt, the NuttX
@@ -255,18 +255,26 @@ Tickless Configuration Options
255
255
256
256
- ``CONFIG_ARCH_HAVE_TICKLESS ``: If the platform provides
257
257
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
260
260
simulated platform:
261
261
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
+
262
270
When the simulation platform is selected,
263
271
``ARCH_HAVE_TICKLESS `` is automatically selected, informing the
264
272
configuration system that *Tickless OS * options can be
265
273
selected.
266
274
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.
270
278
271
279
- ``CONFIG_SCHED_TICKLESS_ALARM ``: The tickless option can be
272
280
supported either via a simple interval timer (plus elapsed
@@ -277,15 +285,15 @@ Tickless Configuration Options
277
285
278
286
The advantage of an alarm is that it avoids some small timing
279
287
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 .
281
289
282
290
- ``CONFIG_USEC_PER_TICK ``: This option is not unique to
283
291
*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
285
293
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,
287
295
``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
289
297
case, ``CONFIG_USEC_PER_TICK `` does not control any timer
290
298
rates. Rather, it only determines the resolution of time
291
299
reported by ``clock_systime_ticks() `` and the resolution of
@@ -342,26 +350,23 @@ platform code must provide the following verify similar functions:
342
350
- ``up_timer_start() ``: Starts (or re-starts)
343
351
the interval timer.
344
352
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
351
357
would run at the rate determined by ``CONFIG_USEC_PER_TICK `` (and
352
358
certainly never slower than that rate).
353
359
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!
365
370
366
371
In addition to these imported interfaces, the RTOS will export the
367
372
following interfaces for use by the platform-specific interval
0 commit comments