Skip to content

Commit 06a395a

Browse files
Add table for FreeRTOS scheduling algorithm configuration (#83)
* add table for scheduler configuration * Code review suggestions
1 parent a76ee51 commit 06a395a

File tree

3 files changed

+36
-29
lines changed

3 files changed

+36
-29
lines changed

ch04.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,25 +1319,25 @@ observed behavior given by the execution sequence shown in Figure 4.12.
13191319
Continuous task 2 running
13201320
Continuous task 2 running
13211321
Periodic task is running
1322-
Continuous task 1 is running
1323-
Continuous task 1 is running
1324-
Continuous task 1 is running
1325-
Continuous task 1 is running
1326-
Continuous task 1 is running
1327-
Continuous task 2 is running
1328-
Continuous task 2 is running
1329-
Continuous task 2 is running
1330-
Continuous task 2 is running
1331-
Continuous task 2 is running
1332-
Continuous task 1 is running
1333-
Continuous task 1 is running
1334-
Continuous task 1 is running
1335-
Continuous task 1 is running
1336-
Continuous task 1 is running
1337-
Continuous task 1 is running
1338-
Continuous task 1 is running
1339-
Continuous task 1 is running
1340-
Continuous task 1 is running
1322+
Continuous task 1 running
1323+
Continuous task 1 running
1324+
Continuous task 1 running
1325+
Continuous task 1 running
1326+
Continuous task 1 running
1327+
Continuous task 2 running
1328+
Continuous task 2 running
1329+
Continuous task 2 running
1330+
Continuous task 2 running
1331+
Continuous task 2 running
1332+
Continuous task 1 running
1333+
Continuous task 1 running
1334+
Continuous task 1 running
1335+
Continuous task 1 running
1336+
Continuous task 1 running
1337+
Continuous task 1 running
1338+
Continuous task 1 running
1339+
Continuous task 1 running
1340+
Continuous task 1 running
13411341
Periodic task is running
13421342
Continuous task 2 running
13431343
Continuous task 2 running
@@ -2159,15 +2159,21 @@ scheduling algorithm does not guarantee time is shared equally between
21592159
tasks of equal priority, only that *Ready* state tasks of equal priority
21602160
enter the *Running* state in turn.
21612161
2162+
<a name="tbl5" title="Table 5 The FreeRTOSConfig.h settings to configure the kernel scheduling algorithms"></a>
2163+
2164+
***
21622165
| Scheduling Algorithm | Prioritized | `configUSE_PREEMPTION` | `configUSE_TIME_SLICING` |
21632166
|---------------------------------|-------------|------------------------|--------------------------|
21642167
| Preemptive With Time Slicing | Yes | 1 | 1 |
21652168
| Preemptive Without Time Slicing | Yes | 1 | 0 |
21662169
| Co-Operative | No | 0 | Any |
21672170
2171+
***Table 5*** *The FreeRTOSConfig.h settings to configure the kernel scheduling algorithms*
2172+
* * *
2173+
21682174
### 4.12.3 Prioritized Preemptive Scheduling with Time Slicing
21692175
2170-
The configuration shown in the table below sets the FreeRTOS scheduler to use a
2176+
The configuration shown in the Table 5 sets the FreeRTOS scheduler to use a
21712177
scheduling algorithm called 'Fixed Priority Preemptive Scheduling with
21722178
Time Slicing', which is the scheduling algorithm used by most small RTOS
21732179
applications, and the algorithm used by all the examples presented in
@@ -2345,7 +2351,7 @@ same task selection and preemption algorithms as described in the
23452351
previous section, but does not use time slicing to share processing time
23462352
between tasks of equal priority.
23472353
2348-
The table below shows the FreeRTOSConfig.h settings that configure the FreeRTOS
2354+
The Table 5 shows the FreeRTOSConfig.h settings that configure the FreeRTOS
23492355
scheduler to use prioritized preemptive scheduling without time slicing.
23502356
23512357
As was demonstrated in Figure 4.19, if time slicing is used, and there is
@@ -2419,7 +2425,7 @@ Referring to Figure 4.21, which assumes `configIDLE_SHOULD_YIELD` is set to 0:
24192425
### 4.12.5 Cooperative Scheduling
24202426
24212427
This book focuses on preemptive scheduling, but FreeRTOS can also use
2422-
cooperative scheduling. The table below shows the FreeRTOSConfig.h settings
2428+
cooperative scheduling. The Table 5 shows the FreeRTOSConfig.h settings
24232429
that configure the FreeRTOS scheduler to use cooperative scheduling.
24242430
24252431
When using the cooperative scheduler (and therefore assuming

ch09.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,12 @@ A task will not enter the Blocked state if its unblock condition is met
365365
at the time `xEventGroupWaitBits()` is called.
366366

367367
Examples of conditions that will result in a task either entering the
368-
Blocked state, or exiting the Blocked state, are provided in Table 5.
369-
Table 5 only shows the least significant four binary bits of the event
368+
Blocked state, or exiting the Blocked state, are provided in Table 6.
369+
Table 6 only shows the least significant four binary bits of the event
370370
group and uxBitsToWaitFor values—the other bits of those two values are
371371
assumed to be zero.
372372

373-
<a name="tbl5" title="Table 5 The Effect of the uxBitsToWaitFor and xWaitForAllBits Parameters"></a>
373+
<a name="tbl6" title="Table 6 The Effect of the uxBitsToWaitFor and xWaitForAllBits Parameters"></a>
374374

375375
* * *
376376
| Existing Event Group Value | uxBitsToWaitFor value | xWaitForAllBits value | Resultant Behavior |
@@ -380,7 +380,7 @@ assumed to be zero.
380380
| 0100 | 0110 | pdFALSE | The calling task will not enter the Blocked state because xWaitForAllBits is pdFALSE, and one of the two bits specified by uxBitsToWaitFor is already set in the event group. |
381381
| 0100 | 0110 | pdTRUE | The calling task will enter the Blocked state because xWaitForAllBits is pdTRUE, and only one of the two bits specified by uxBitsToWaitFor is already set in the event group. The task will leave the Blocked state when both bit 1 and bit 2 are set in the event group. |
382382

383-
***Table 5*** *The Effect of the uxBitsToWaitFor and xWaitForAllBits Parameters*
383+
***Table 6*** *The Effect of the uxBitsToWaitFor and xWaitForAllBits Parameters*
384384
* * *
385385

386386
The calling task specifies bits to test using the `uxBitsToWaitFor`
@@ -414,7 +414,7 @@ operation (uninterruptable by other tasks or interrupts).
414414

415415
For example, if the calling task wants to wait for event bit 0 and/or
416416
event bit 2 to become set in the event group, then set `uxBitsToWaitFor`
417-
to 0x05 (binary 0101). Refer to Table 5 for further examples.
417+
to 0x05 (binary 0101). Refer to Table 6 for further examples.
418418

419419
- `xClearOnExit`
420420

@@ -446,7 +446,7 @@ operation (uninterruptable by other tasks or interrupts).
446446
`uxBitsToWaitFor` are set (or the timeout specified by the `xTicksToWait`
447447
parameter expires).
448448

449-
Refer to Table 5 for examples.
449+
Refer to Table 6 for examples.
450450

451451
- `xTicksToWait`
452452

toc.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,4 +603,5 @@
603603
+ [Table 2 TickType\_t data type and the configTICK\_TYPE\_WIDTH\_IN\_BITS configuration](ch02.md#tbl2)
604604
+ [Table 3 Macro prefixes](ch02.md#tbl3)
605605
+ [Table 4 Common macro definitions](ch02.md#tbl4)
606-
+ [Table 5 The Effect of the uxBitsToWaitFor and xWaitForAllBits Parameters](ch09.md#tbl5)
606+
+ [Table 5 The FreeRTOSConfig.h settings to configure the kernel scheduling algorithms](ch04.md#tbl5)
607+
+ [Table 6 The Effect of the uxBitsToWaitFor and xWaitForAllBits Parameters](ch09.md#tbl6)

0 commit comments

Comments
 (0)