doc: Add a memo.

This commit is contained in:
NIIBE Yutaka
2019-04-24 09:35:29 +09:00
parent 886343d40d
commit 2db324e93d
2 changed files with 30 additions and 12 deletions

View File

@@ -185,7 +185,8 @@ Returns old state which is 0 when it was enabled.
@subheading chopstx_poll @subheading chopstx_poll
@anchor{chopstx_poll} @anchor{chopstx_poll}
@deftypefun {int} {chopstx_poll} (uint32_t * @var{usec_p}, int @var{n}, struct chx_poll_head *const [] @var{pd_array}) @deftypefun {int} {chopstx_poll} (uint32_t * @var{usec_p}, int @var{n}, struct chx_poll_head *const [] @var{pd_array})
@var{usec_p}: Pointer to usec for timeout. Forever if NULL. @var{usec_p}: Pointer to usec for timeout. Forever if NULL. It is
updated on return
@var{n}: Number of poll descriptors @var{n}: Number of poll descriptors

View File

@@ -60,8 +60,8 @@ section entitled ``Copying''.
@menu @menu
* Introduction:: What is Chopstx. * Introduction:: What is Chopstx.
* Threads and only Threads:: Threads and only Threads. * Threads and only Threads:: Threads and only Threads.
* Poll or Pole:: Poll or Pole. * Poll or Pole::
* Note (Use of sleep mode):: Use it carefully. * Use of sleep mode:: Use it carefully.
* Compile-time macro:: Macro to be defined. * Compile-time macro:: Macro to be defined.
* API:: API. * API:: API.
* Memorandom:: Memorandom for the implementation. * Memorandom:: Memorandom for the implementation.
@@ -90,8 +90,8 @@ Indexes
Chopstx is an RT thread library for ARM Cortex-M0, Cortex-M0plus, Chopstx is an RT thread library for ARM Cortex-M0, Cortex-M0plus,
Cortex-M3, Cortex-M4 with no FPU or DSP, and GNU/Linux emulation. Cortex-M3, Cortex-M4 with no FPU or DSP, and GNU/Linux emulation.
Specifically, it is used for STM32F030, MKL27Z, STM32F103, GD32F103 Specifically, it is used for STM32F030, MKL27Z, STM32F103, GD32F103,
and as a command on GNU/Linux. STM32L432 and as a command on GNU/Linux.
While most RTOSes come with many features, drivers, and stacks, While most RTOSes come with many features, drivers, and stacks,
Chopstx just offers an RT thread library. Chopstx just offers an RT thread library.
@@ -147,8 +147,8 @@ programming style, with minimum number of threads, avoiding
complicated dependency between threads. complicated dependency between threads.
@node Note (Use of sleep mode) @node Use of sleep mode
@chapter Note (Use of sleep mode) @chapter Use of sleep mode
Calling the chopstx_conf_idle function (> 0) to allow the idle thread Calling the chopstx_conf_idle function (> 0) to allow the idle thread
going to sleep. MCU will be in sleep mode when no threads are going to sleep. MCU will be in sleep mode when no threads are
@@ -180,15 +180,18 @@ Running CPU clock in MHz. Used for chopstx_usec_wait.
@include chopstx-api.texi @include chopstx-api.texi
@node Memorandom for the implementation @node Memorandom
@chapter Memorandom for the implementation @chapter Memorandom for the implementation
@menu @menu
* Honourable poverty:: Wabi and Sabi. * Honourable poverty:: Wabi and Sabi.
* Better interrupt handling:: Better interrupt handling. * Better interrupt handling::
* Static and deterministic when possible::
@end menu
@node Honourable poverty @node Honourable poverty
@section Honourable poverty @section Honourable poverty
Chopstx is an effort against many features. It encourages doing Chopstx is an effort against many features. It encourages doing
harder decision earlier. harder decision earlier.
@@ -206,12 +209,12 @@ complexity matters. Now, it's more difficult to manage the
complexity. complexity.
With full of resources, it became possible deferring difficult With full of resources, it became possible deferring difficult
hardware or lower-level decisions to upper level, by supporting both hardware or lower-level decisions to upper layer, by supporting both
ways, when we have a choice. It used to be considered a good ways, when we have a choice. It used to be considered a good
practice. practice.
But, eventually, as a system, it may result many knobs, full of But, eventually, as a system, it may result many knobs, full of
options, which might difficult to manage. options, which might be too difficult to manage.
In this situation, against existing practice, Chopstx is a challenge In this situation, against existing practice, Chopstx is a challenge
to handle all food by only two wooden sticks. It's not fork and exec to handle all food by only two wooden sticks. It's not fork and exec
@@ -228,7 +231,7 @@ I hope Chopstx is the one for you.
@section Better interrupt handling @section Better interrupt handling
In Chopstx, all interrupt handling is done by a single routine named In Chopstx, all interrupt handling is done by a single routine named
chx_handle_intr. It uses liner list search to find a thread which chx_handle_intr. It uses linear list search to find a thread which
handles the interrupt. In the fixed vector_table, we see many of handles the interrupt. In the fixed vector_table, we see many of
chx_handle_intr entries. chx_handle_intr entries.
@@ -248,6 +251,20 @@ When I have an opportunity to design MCU, I don't support larger
interrupt vector table. interrupt vector table.
@node Static and deterministic when possible
@section Static and deterministic when possible
When an application enables features dynamically, it may invite
non-deterministic bugs. Typical example: the order of driver
initialization matters, because of hidden dependency in a hardware
implementation. To cover all the cases, tests needed can become huge.
A simple practice like following is good when it's enough: doing all
initialization at start, then running threads to work.
If possible, avoid supporting fine grain power control and/or dynamic
clock frequency change.
@c ******************************************** @c ********************************************
@include gpl.texi @include gpl.texi