From 247bc08bc26c95e7484fa587b9f68eb5887b4479 Mon Sep 17 00:00:00 2001 From: Christopher Kormanyos Date: Sun, 4 Feb 2024 10:10:17 +0100 Subject: [PATCH] Update various docs and comments --- examples/chapter02_02/cstdint | 8 ++++---- examples/chapter02_02/led.cpp | 2 +- examples/chapter02_02/readme.md | 2 +- examples/readme.md | 17 ++++++++++++++++- readme.md | 3 ++- ref_app/src/app/benchmark/readme.md | 14 +++++++------- ref_app/src/mcal/nxp_imxrt1062/mcal_port.h | 2 +- ref_app/target/build/build.bat | 4 ++-- 8 files changed, 34 insertions(+), 18 deletions(-) diff --git a/examples/chapter02_02/cstdint b/examples/chapter02_02/cstdint index 92f2348d5..9e4295107 100644 --- a/examples/chapter02_02/cstdint +++ b/examples/chapter02_02/cstdint @@ -1,12 +1,12 @@ /////////////////////////////////////////////////////////////////////////////// -// Copyright Christopher Kormanyos 2007 - 2021. +// Copyright Christopher Kormanyos 2007 - 2024. // Distributed under the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) // -#ifndef _CSTDINT_2010_02_23_H_ - #define _CSTDINT_2010_02_23_H_ +#ifndef _CSTDINT_2010_02_23 + #define _CSTDINT_2010_02_23 #include @@ -45,4 +45,4 @@ typedef ::uintmax_t uintmax_t; } -#endif // _CSTDINT_2010_02_23_H_ +#endif // _CSTDINT_2010_02_23 diff --git a/examples/chapter02_02/led.cpp b/examples/chapter02_02/led.cpp index 7a2c09515..7624b80f7 100644 --- a/examples/chapter02_02/led.cpp +++ b/examples/chapter02_02/led.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Copyright Christopher Kormanyos 2007 - 2023. +// Copyright Christopher Kormanyos 2007 - 2024. // Distributed under the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt // or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/examples/chapter02_02/readme.md b/examples/chapter02_02/readme.md index 967cbf7ee..75cd0876a 100644 --- a/examples/chapter02_02/readme.md +++ b/examples/chapter02_02/readme.md @@ -2,7 +2,7 @@ ## The LED program

- +

diff --git a/examples/readme.md b/examples/readme.md index acdb9e5b4..528fa1202 100644 --- a/examples/readme.md +++ b/examples/readme.md @@ -6,6 +6,8 @@ Real-Time-C++ - Examples Build Examples Boost Software License 1.0 + +

These examples are motivated by the book @@ -15,7 +17,6 @@ Efficient Object-Oriented and Template Microcontroller Programming, Fourth Edition (Springer, Heidelberg, 2021) ISBN 9783662629956. - The first couple of example projects can use the ARDUINO board directly and non-modified. Examples from the later chapters in the book do, however, need additional components at times. These need to be provided independently. @@ -122,3 +123,17 @@ over multitasking using time slices. For further informatin on the examples, see the readme notes in each individual example directory. + +## Try it at _godbolt_ + +

+ + +

+ +Use this [short link](https://godbolt.org/z/fxWzb6h6f) +to [godbolt](https://godbolt.org) in order to further explore this program. + +In the afore-mentioned link, the main source file of +Example ![chapter02_02](https://github.com/ckormanyos/real-time-cpp/tree/master/examples/chapter02_02) +(the LED program) is compiled with a modern `avr-gcc` compiler. diff --git a/readme.md b/readme.md index 6c4e8b8d8..841791141 100644 --- a/readme.md +++ b/readme.md @@ -102,7 +102,8 @@ The reference application supports the following targets: ## Getting Started with the Reference Application It is easiest to get started with the reference application using one of the -supported boards, such as Arduino or RaspberryPi ZERO or BeagleBone, etc. +supported boards, such as `avr` (ARDUINO) or `bcm2835_raspi_b` +(RaspberryPi ZERO) or `am335x` (BeagleBoneBlack), etc. The reference application can be found in the directory [ref_app](./ref_app) and its subdirectories. diff --git a/ref_app/src/app/benchmark/readme.md b/ref_app/src/app/benchmark/readme.md index 89bf41a1c..d3cbf671b 100644 --- a/ref_app/src/app/benchmark/readme.md +++ b/ref_app/src/app/benchmark/readme.md @@ -81,16 +81,16 @@ template class. A typical range of performance classes is shown in the following table. The benchmark used is a ${\sim}100$ decimal digit AGM $\pi$ calculation. -| Target | runtime [ms] | relative | -|-------------|---------------|------------| -| am335x | 1.5 | 1.0 | -| stm32f446 | 2.5 | 1.7 | -| avr | 470 | 370 | +| Target | runtime $[ms]$ | relative | +|-------------|-----------------|------------| +| `am335x` | 1.5 | 1.0 | +| `stm32f446` | 5.1 | 3.4 | +| `avr` | 420 | 280 | There are strikingly differing performance classes -for the $8$-bit MICROCHIP(R) AVR controller of the Arduino +for the $8$-bit MICROCHIP(R) AVR controller of the ARDUINO and the $32$-bit ARM(R) 8 controller of the BeagleBone Black Edition, Rev. C. The $\pi$ calculation requires approximately -$470~\text{ms}$ and $1.5~\text{ms}$, +$420~\text{ms}$ and $1.5~\text{ms}$, respectively, on these two microcontroller systems. diff --git a/ref_app/src/mcal/nxp_imxrt1062/mcal_port.h b/ref_app/src/mcal/nxp_imxrt1062/mcal_port.h index cfed7fc89..6c73ce93d 100644 --- a/ref_app/src/mcal/nxp_imxrt1062/mcal_port.h +++ b/ref_app/src/mcal/nxp_imxrt1062/mcal_port.h @@ -13,7 +13,7 @@ // NOTE: The following table reproduces the layout information of Teensy 4.0. // See also: https://github.com/KurtE/TeensyDocuments // - // Teensy-Pin "Arduino"-Pin Name GPIO + // Teensy-Pin "ARDUINO"-Pin Name GPIO // 1 AD_B0_02 1.02 // 0 AD_B0_03 1.03 // 24 A10 AD_B0_12 1.12 diff --git a/ref_app/target/build/build.bat b/ref_app/target/build/build.bat index 006942c9b..925526091 100644 --- a/ref_app/target/build/build.bat +++ b/ref_app/target/build/build.bat @@ -1,5 +1,5 @@ @rem -@rem Copyright Christopher Kormanyos 2007 - 2023. +@rem Copyright Christopher Kormanyos 2007 - 2024. @rem Distributed under the Boost Software License, @rem Version 1.0. (See accompanying file LICENSE_1_0.txt @rem or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -11,7 +11,7 @@ @rem @rem %1: target @rem am335x : BeagleBone with TI(R) AM3359, creates a bare-metal binary file "MLO" -@rem avr : ATMEL(R) AVR(R) ATmega328P i.e., Arduino compatible +@rem avr : ATMEL(R) AVR(R) ATmega328P i.e., ARDUINO compatible @rem bcm2835_raspi_b : RaspberryPi Zero, creates a bare-metal binary file "kernel.img" @rem rl78 : Renesas(R) RL78 @rem rx63n : Renesas(R) RX600