Skip to content

Commit 510d704

Browse files
authored
Removal of unnecessary lines and correction of Index numbers of Listings and Examples (#74)
* Update ch02.md Removing Lines after Listing * Update ch03.md removing unnecessary lines * Update ch04.md updates for removing extra lines * Update ch04.md formatting made consistent * Update ch04.md * Update ch04.md * Update ch05.md * Update ch06.md * Update ch07.md * Update ch08.md * Update ch08.md * Update ch08.md * Update ch09.md * Update ch10.md * Update ch11.md * Update ch12.md * Update ch13.md * Update ch04.md * Update ch05.md * Update ch06.md * Update ch07.md * Update ch08.md * Update ch08.md * Update ch09.md * Update ch10.md * Update toc.md * Update toc.md * Update ch04.md corrected Figure Heading format * Update ch04.md
1 parent 0c988ec commit 510d704

File tree

13 files changed

+445
-777
lines changed

13 files changed

+445
-777
lines changed

ch02.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ FreeRTOS-Plus
122122
123123
└─Demo Contains demo projects for other FreeRTOS and ecosystem libraries
124124
```
125-
*Figure 2.1 Top level directories within the FreeRTOS distribution*
125+
***Figure 2.1*** *Top level directories within the FreeRTOS distribution*
126126
* * *
127127

128128
The distribution only contains one copy of the FreeRTOS kernel source
@@ -188,7 +188,7 @@ FreeRTOS
188188
├─stream_buffer.c FreeRTOS source file - optional
189189
└─croutine.c FreeRTOS source file – optional and no longer maintained
190190
```
191-
*Figure 2.2 Core FreeRTOS source files within the FreeRTOS directory tree*
191+
***Figure 2.2*** *Core FreeRTOS source files within the FreeRTOS directory tree*
192192
* * *
193193

194194
It is recognized that the file names used in the zip file distribution
@@ -248,7 +248,7 @@ FreeRTOS
248248
├─[architecture 2] Contains files for the compiler 2 architecture 2 port
249249
└─[etc.]
250250
```
251-
*Figure 2.3 Port specific source files within the FreeRTOS directory tree*
251+
***Figure 2.3*** *Port specific source files within the FreeRTOS directory tree*
252252
* * *
253253

254254
### 2.2.8 Include Paths
@@ -374,7 +374,7 @@ FreeRTOS source files, but does not define any functionality.
374374

375375
<a name="list2.1" title="Listing 2.1 The template for a new main() function"></a>
376376

377-
* * *
377+
378378
```c
379379
int main( void )
380380
{
@@ -392,8 +392,8 @@ int main( void )
392392
return 0;
393393
}
394394
```
395-
*Listing 2.1 The template for a new main() function*
396-
* * *
395+
***Listing 2.1*** *The template for a new main() function*
396+
397397
398398
399399
### 2.4.2 Creating a New Project from Scratch
@@ -442,7 +442,7 @@ procedure to create a new project:
442442
| All C and assembler files | FreeRTOS/Source/portable/\[compiler\]/\[architecture\] |
443443
| heap\_n.c | FreeRTOS/Source/portable/MemMang, where n is either 1, 2, 3, 4 or 5 |
444444
445-
*Table 1 FreeRTOS source files to include in the project*
445+
***Table 1*** *FreeRTOS source files to include in the project*
446446
* * *
447447
448448
**Note on heap memory:**
@@ -498,7 +498,7 @@ typedef used and the actual type:
498498
| TICK\_TYPE\_WIDTH\_32_BITS | uint32\_t | uint32\_t | uint32\_t | N/A |
499499
| TICK\_TYPE\_WIDTH\_64_BITS | N/A | N/A | uint64\_t | uint64\_t |
500500
501-
*Table 2. TickType_t data type and the configTICK_TYPE_WIDTH_IN_BITS configuration*
501+
***Table 2*** *TickType_t data type and the configTICK_TYPE_WIDTH_IN_BITS configuration*
502502
* * *
503503
504504
- `BaseType_t`
@@ -562,7 +562,7 @@ list of prefixes.
562562
| config (for example, `configUSE_PREEMPTION`) | `FreeRTOSConfig.h` |
563563
| err (for example, `errQUEUE_FULL`) | `projdefs.h` |
564564
565-
*Table 3 Macro prefixes*
565+
***Table 3*** *Macro prefixes*
566566
* * *
567567
568568
Note that the semaphore API is written almost entirely as a set of
@@ -581,7 +581,7 @@ The macros defined in Table 4 are used throughout the FreeRTOS source code.
581581
| `pdPASS` | 1 |
582582
| `pdFAIL` | 0 |
583583
584-
*Table 4 Common macro definitions*
584+
***Table 4*** *Common macro definitions*
585585
* * *
586586
587587

ch03.md

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ Referring to Figure 3.1:
145145

146146
* * *
147147
![](media/image05.png)
148-
*Figure 3.1 RAM being allocated from the heap\_1 array each time a task is created*
148+
***Figure 3.1*** *RAM being allocated from the heap\_1 array each time a task is created*
149149
* * *
150150

151151

@@ -189,7 +189,7 @@ subsequently freed blocks are always the same size.
189189

190190
* * *
191191
![](media/image06.png)
192-
*Figure 3.2 RAM being allocated and freed from the heap\_2 array as tasks are created and deleted*
192+
***Figure 3.2*** *RAM being allocated and freed from the heap\_2 array as tasks are created and deleted*
193193
* * *
194194

195195
Figure 3.2 demonstrates how the best-fit algorithm works when a task is
@@ -276,7 +276,7 @@ RAM.
276276

277277
* * *
278278
![](media/image07.png)
279-
*Figure 3.3 RAM being allocated and freed from the heap\_4 array*
279+
***Figure 3.3*** *RAM being allocated and freed from the heap\_4 array*
280280
* * *
281281

282282
Figure 3.3 demonstrates how the heap\_4 first-fit algorithm with memory
@@ -350,12 +350,12 @@ the call to `vPortDefineHeapRegions()`.
350350

351351
<a name="list3.1" title="Listing 3.1 The vPortDefineHeapRegions() API function prototype"></a>
352352

353-
* * *
353+
354354
```c
355355
void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions );
356356
```
357-
*Listing 3.1 The vPortDefineHeapRegions() API function prototype*
358-
* * *
357+
***Listing 3.1*** *The vPortDefineHeapRegions() API function prototype*
358+
359359
360360
`vPortDefineHeapRegions()` takes an array of `HeapRegion_t` structures as
361361
its only parameter. Each structure defines the start address and size of
@@ -365,7 +365,7 @@ structures defines the entire heap space.
365365
366366
<a name="list3.2" title="Listing 3.2 The HeapRegion\_t structure"></a>
367367
368-
* * *
368+
369369
```c
370370
typedef struct HeapRegion
371371
{
@@ -377,8 +377,8 @@ typedef struct HeapRegion
377377
378378
} HeapRegion_t;
379379
```
380-
*Listing 3.2 The HeapRegion\_t structure*
381-
* * *
380+
***Listing 3.2*** *The HeapRegion\_t structure*
381+
382382

383383
**Parameters:**
384384

@@ -407,7 +407,7 @@ which is not shown.
407407

408408
* * *
409409
![](media/image08.png)
410-
*Figure 3.4 Memory Map*
410+
***Figure 3.4*** *Memory Map*
411411
* * *
412412

413413
Listing 3.3 shows an array of `HeapRegion_t` structures that together
@@ -416,7 +416,7 @@ describe the three blocks of RAM in their entirety.
416416

417417
<a name="list3.3" title="Listing 3.3 An array of HeapRegion\_t structures that together describe the 3 regions of RAM in their entirety"></a>
418418

419-
* * *
419+
420420
```c
421421
/* Define the start address and size of the three RAM regions. */
422422
#define RAM1_START_ADDRESS ( ( uint8_t * ) 0x00010000 )
@@ -449,8 +449,8 @@ int main( void )
449449
/* Add application code here. */
450450
}
451451
```
452-
*Listing 3.3 An array of HeapRegion\_t structures that together describe the 3 regions of RAM in their entirety*
453-
* * *
452+
***Listing 3.3*** *An array of HeapRegion\_t structures that together describe the 3 regions of RAM in their entirety*
453+
454454
455455
Although Listing 3.3 correctly describes the RAM, it does not demonstrate a
456456
usable example because it allocates all the RAM to the heap, leaving no
@@ -494,7 +494,6 @@ linker consumes all of RAM1, as shown in Figure 3.4 **C**.
494494
495495
<a name="list3.4" title="Listing 3.4 An array of HeapRegion\_t structures that describe all of RAM2, all of RAM3, but only part of RAM1"></a>
496496
497-
* * *
498497
```c
499498
/* Define the start address and size of the two RAM regions not used by
500499
the linker. */
@@ -524,8 +523,8 @@ const HeapRegion_t xHeapRegions[] =
524523
{ NULL, 0 } /* Marks the end of the array. */
525524
};
526525
```
527-
*Listing 3.4 An array of HeapRegion\_t structures that describe all of RAM2, all of RAM3, but only part of RAM1*
528-
* * *
526+
***Listing 3.4*** *An array of HeapRegion\_t structures that describe all of RAM2, all of RAM3, but only part of RAM1*
527+
529528

530529
The advantages of the technique demonstrated in Listing 3.4 include:
531530

@@ -575,22 +574,22 @@ documentation. Examples for two compilers follow:
575574

576575
<a name="list3.5" title="Listing 3.5 Using GCC syntax to declare the array that will be used by heap\_4, and place the array in a memory section named .my\_heap"></a>
577576

578-
* * *
577+
579578
```c
580579
uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] __attribute__ ( ( section( ".my_heap" ) ) );
581580
```
582-
*Listing 3.5 Using GCC syntax to declare the array that will be used by heap\_4, and place the array in a memory section named .my\_heap*
583-
* * *
581+
***Listing 3.5*** *Using GCC syntax to declare the array that will be used by heap\_4, and place the array in a memory section named .my\_heap*
582+
584583

585584

586585
<a name="list3.6" title="Listing 3.6 Using IAR syntax to declare the array that will be used by heap\_4, and place the array at the absolute address 0x20000000"></a>
587586

588-
* * *
587+
589588
```c
590589
uint8_t ucHeap[ configTOTAL_HEAP_SIZE ] @ 0x20000000;
591590
```
592-
*Listing 3.6 Using IAR syntax to declare the array that will be used by heap\_4, and place the array at the absolute address 0x20000000*
593-
* * *
591+
***Listing 3.6*** *Using IAR syntax to declare the array that will be used by heap\_4, and place the array at the absolute address 0x20000000*
592+
594593

595594

596595
### 3.3.2 The xPortGetFreeHeapSize() API Function
@@ -604,12 +603,12 @@ information on heap fragmentation.
604603

605604
<a name="list3.7" title="Listing 3.7 The xPortGetFreeHeapSize() API function prototype"></a>
606605

607-
* * *
606+
608607
```c
609608
size_t xPortGetFreeHeapSize( void );
610609
```
611-
*Listing 3.7 The xPortGetFreeHeapSize() API function prototype*
612-
* * *
610+
***Listing 3.7*** *The xPortGetFreeHeapSize() API function prototype*
611+
613612
614613
**Return value:**
615614
@@ -639,12 +638,12 @@ after executing the code that you know has the highest heap usage,
639638
640639
<a name="list3.8" title="Listing 3.8 The xPortGetMinimumEverFreeHeapSize() API function prototype"></a>
641640
642-
* * *
641+
643642
```c
644643
size_t xPortGetMinimumEverFreeHeapSize( void );
645644
```
646-
*Listing 3.8 The xPortGetMinimumEverFreeHeapSize() API function prototype*
647-
* * *
645+
***Listing 3.8*** *The xPortGetMinimumEverFreeHeapSize() API function prototype*
646+
648647

649648
**Return value:**
650649

@@ -663,17 +662,17 @@ shows the `HeapStats_t` structure members.
663662

664663
<a name="list3.9" title="Listing 3.9 The vPortGetHeapStatus() API function prototype"></a>
665664

666-
* * *
665+
667666
```c
668667
void vPortGetHeapStats( HeapStats_t *xHeapStats );
669668
```
670-
*Listing 3.9 The vPortGetHeapStatus() API function prototype*
671-
* * *
669+
***Listing 3.9*** *The vPortGetHeapStatus() API function prototype*
670+
672671
673672
674673
<a name="list3.10" title="Listing 3.10 The HeapStatus\_t() structure"></a>
675674
676-
* * *
675+
677676
```c
678677
/* Prototype of the vPortGetHeapStats() function. */
679678
void vPortGetHeapStats( HeapStats_t *xHeapStats );
@@ -710,8 +709,8 @@ typedef struct xHeapStats
710709
size_t xNumberOfSuccessfulFrees;
711710
} HeapStats_t;
712711
```
713-
*Listing 3.10 The HeapStatus\_t() structure*
714-
* * *
712+
***Listing 3.10*** *The HeapStatus\_t() structure*
713+
715714

716715

717716
### 3.3.5 Collecting Per-task Heap Usage Statistics
@@ -751,12 +750,12 @@ which should gracefully recover from allocation failures.
751750

752751
<a name="list3.11" title="Listing 3.11 The malloc failed hook function name and prototype"></a>
753752

754-
* * *
753+
755754
```c
756755
void vApplicationMallocFailedHook( void );
757756
```
758-
*Listing 3.11 The malloc failed hook function name and prototype*
759-
* * *
757+
***Listing 3.11*** *The malloc failed hook function name and prototype*
758+
760759
761760
762761
### 3.3.7 Placing Task Stacks in Fast Memory
@@ -774,7 +773,7 @@ macros to call application-provided functions as shown in Listing 3.12.
774773
775774
<a name="list3.12" title="Listing 3.12 Mapping the pvPortMallocStack() and vPortFreeStack() macros to an application defined memory allcator"></a>
776775
777-
* * *
776+
778777
```c
779778
/* Functions provided by the application writer than allocate and free
780779
memory from a fast area of RAM. */
@@ -790,8 +789,8 @@ void vPortFreeFastMemory( void *pvBlockToFree );
790789
791790
#define vPortFreeStack( x ) vPortFreeFastMemory( x )
792791
```
793-
*Listing 3.12 Mapping the pvPortMallocStack() and vPortFreeStack() macros to an application defined memory allcator*
794-
* * *
792+
***Listing 3.12*** *Mapping the pvPortMallocStack() and vPortFreeStack() macros to an application defined memory allcator*
793+
795794

796795

797796
## 3.4 Using Static Memory Allocation
@@ -850,7 +849,7 @@ also return the size of the timer task stack. A suggested implementation of the
850849

851850
<a name="list3.13" title="Listing 3.13 Typical implementation of vApplicationGetTimerTaskMemory"></a>
852851

853-
* * *
852+
854853
```c
855854
void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer,
856855
StackType_t **ppxTimerTaskStackBuffer,
@@ -874,8 +873,8 @@ void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer,
874873
*pulTimerTaskStackSize = sizeof(uxTimerTaskStack) / sizeof(*uxTimerTaskStack);
875874
}
876875
```
877-
*Listing 3.13 Typical implementation of vApplicationGetTimerTaskMemory*
878-
* * *
876+
***Listing 3.13*** *Typical implementation of vApplicationGetTimerTaskMemory*
877+
879878
880879
Since there is only a single timer task in any system including SMP, a valid solution to the timer task memory problem
881880
is to allocate static buffers in the `vApplicationGetTimeTaskMemory()` function and return the buffer pointers to the kernel.
@@ -894,7 +893,6 @@ variables to create the needed buffers.
894893
895894
<a name="list3.14" title="Listing 3.14 Typical implementation of vApplicationGetIdleTaskMemory"></a>
896895
897-
* * *
898896
```c
899897
void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer,
900898
StackType_t **ppxIdleTaskStackBuffer,
@@ -908,5 +906,5 @@ void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer,
908906
*pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
909907
}
910908
```
911-
*Listing 3.14 Typical implementation of vApplicationGetIdleTaskMemory*
912-
* * *
909+
***Listing 3.14*** *Typical implementation of vApplicationGetIdleTaskMemory*
910+

0 commit comments

Comments
 (0)