Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/real-time-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,19 @@ jobs:
working-directory: ./
- name: install-osx-cross-homebrew-avr
run: |
echo 'Tap osx-cross/homebrew-avr on MacOS via brew'
echo 'Tap, trust and install osx-cross/avr on MacOS via brew'
echo ""
echo 'Install osx-cross/homebrew-avr on MacOS via brew'
cd ${{ runner.workspace }}/homebrew-avr
brew tap osx-cross/avr
brew install avr-gcc@12
brew trust aws/tap azure/bicep osx-cross/avr
brew install osx-cross/avr/avr-gcc@15
working-directory: ./
- name: target-avr-macos-${{ matrix.suite }}
run: |
echo query the GNUmake version
make --version
echo Add the brew-installed-avr-gcc@12 path
PATH="/opt/homebrew/opt/avr-gcc@12/bin:$PATH"
echo Add the brew-installed-avr-gcc@15 path
PATH="/opt/homebrew/opt/avr-gcc@15/bin:$PATH"
echo ""
echo Query the avr-gcc version
avr-g++ -v
Expand Down
10 changes: 4 additions & 6 deletions code_snippets/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ Real-Time-C++ - Code Snippets
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" /></a>
</p>

These are the code snippets from the chapters of the book
C.M. Kormanyos,
[Real-Time C++](https://www.springer.com/de/book/9783662629956):
Efficient Object-Oriented
and Template Microcontroller Programming, Fourth Edition
(Springer, Heidelberg, 2021) ISBN 9783662629956.
These are the code snippets from the chapters
of the book C.M. Kormanyos, _Real-Time_ _C++:_ _Efficient_ _Object-Oriented_
_and_ _Template_ _Microcontroller_ _Programming_, _4_$^{th}$ _Edition_
and are made available for educational and exploratory use.

## Summary of the Code Snippets

Expand Down
6 changes: 3 additions & 3 deletions examples/chapter02_02/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## The LED program

<p align="center">
<a href="https://godbolt.org/z/fxWzb6h6f">
<a href="https://godbolt.org/z/zbcof9E94">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt" />
</a>
</p>
Expand Down Expand Up @@ -160,7 +160,7 @@ such as:

## Try it at _godbolt_

Use the following [short link](https://godbolt.org/z/v5f45fMqq)
Use the following [short link](https://godbolt.org/z/zbcof9E94)
to [godbolt](https://godbolt.org) in order to further explore this program.

In the afore-mentioned link, the file [`led.cpp`](./led.cpp) is,
Expand All @@ -171,7 +171,7 @@ but not executed because there is no target hardware available.
### On the Metal: _Clear_ and _Set_ Bit

Consider the assembly output near the bottom of the page in the right-side tab
of the [short link](https://godbolt.org/z/v5f45fMqq)
of the [short link](https://godbolt.org/z/zbcof9E94)
to [godbolt](https://godbolt.org). Upon close investigation,
the bit-_clear_ and bit-_set_ opcodes (`cbi` and `sbi`)
can be recognized.
Expand Down
4 changes: 2 additions & 2 deletions examples/chapter03_02/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Integer Types Having Fixed Widths and Prime Numbers

<p align="center">
<a href="https://godbolt.org/z/dPbM7v4ff">
<a href="https://godbolt.org/z/Pa3WbG8h6">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt" /></a>
</p>

Expand Down Expand Up @@ -89,7 +89,7 @@ A nifty little PC-based sieving program from the code snippets area helps to
[explore prime numbers](../../code_snippets/chapter03/chapter03_02-002a_explore_prime_numbers.cpp).

This code can be run in its entirety at the following
[short link](https://godbolt.org/z/dPbM7v4ff) to [godbolt](https://godbolt.org).
[short link](https://godbolt.org/z/Pa3WbG8h6) to [godbolt](https://godbolt.org).

## Prime Counting Function

Expand Down
4 changes: 2 additions & 2 deletions examples/chapter06_01/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## A CRC Benchmark

<p align="center">
<a href="https://godbolt.org/z/ssTK8TjWj">
<a href="https://godbolt.org/z/vvobo4Pnq">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt" /></a>
</p>

Expand Down Expand Up @@ -91,7 +91,7 @@ The expected result of the CRC-32/MPEG-2 of these
data bytes is `0x0376'E6E7`.

This code can be run in its entirety at the following
[short link](https://godbolt.org/z/ssTK8TjWj) to [godbolt](https://godbolt.org).
[short link](https://godbolt.org/z/vvobo4Pnq) to [godbolt](https://godbolt.org).

The application benchmark task `app::benchmark::task_func`
computes the CRC-32/MPEG-2. The computation is run to completion
Expand Down
4 changes: 2 additions & 2 deletions examples/chapter10_08/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## External SPI RAM and Computing 10,001 Digits of Pi

<p align="center">
<a href="https://godbolt.org/z/EMx88ocxn">
<a href="https://godbolt.org/z/cr7MxKsK3">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt" /></a>
</p>

Expand Down Expand Up @@ -66,7 +66,7 @@ A similar implementation of the Pi Spigot program has been setup
at [godbolt](https://godbolt.org), where it can be compiled and executed.
This setup computes $10,001$ decimal digits of $\pi$.

Use the following [short link](https://godbolt.org/z/EMx88ocxn)
Use the following [short link](https://godbolt.org/z/cr7MxKsK3)
to further explore this program.

## 8-Bit MCU Adaptions
Expand Down
Binary file added examples/chapter16_08/images/circuit16_08.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions examples/chapter16_08/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example Chapter16_08 (advanced level)

## Generate and Display 128-bit Random Prime Numbers

This advanced example uses a self-made pseudo-random electronic
Expand Down Expand Up @@ -34,7 +35,7 @@ from Newhaven Display International. The display
is 40 characters in width by 4 lines and is, in fact,
controlled as two individual displays packed together.

The realease version of this software is intended to run on our target
The release version of this software is intended to run on our target
with the 8-bit microcontroller, as shown below.
On this system, it takes approximately $15~\text{s}$ on average
to find each single new pseudo-random 128-bit prime.
Expand All @@ -51,10 +52,10 @@ project uses
[Boost.Multiprecision](https://www.boost.org/doc/libs/1_82_0/libs/multiprecision/doc/html/index.html)
for its 128-bit integer representation and independent primality testing.

This advanced example's software running on an 8-bit micrcocontroller
This advanced example's software running on an 8-bit microcontroller
exhibits a fascinating combination of elementary electronics,
real-time C++ object-oriented and template programming,
and the inate elegance and beauty of pure mathematics.
and the innate elegance and beauty of pure mathematics.

## Hardware Setup

Expand All @@ -71,7 +72,7 @@ of the breadboard. The $12~\text{V}$ supply (center left) stems from a classic L
voltage regulator, from which TTL $+5~\text{V}$ (upper left) is also derived for
the MCU and logic power rail.

![](./images/board16_08.jpg)
![View of hardware setup](./images/board16_08.jpg)

In this particular image,
the system has accumulated a few hundred pseudo-random prime
Expand All @@ -83,21 +84,20 @@ with the prime number theorem.
The electronic subcircuit used for creating the random digitized noise
is sketched below.

![](./images/circuit16_08.svg)
![Schematic view of the random noise generator subcircuit](./images/circuit16_08.png)

The oscilloscope image below shows a small snapshot
of the random digitized noise from this circuit.
The square-wave-like pulses result from digitizing the random signal
above/below $0~\text{V}$. This is done with an op-amp and rudimentary logic,
as shown in the circuit.

![](./images/signal16_08.jpg)
![View of the generated noise on oscilloscope](./images/signal16_08.jpg)

## Deep Connection to the Prime Number Theorem

Recall the prime counting function
previously encountered in Example Chapter03_02
[here](https://github.com/ckormanyos/real-time-cpp/tree/master/examples/chapter03_02#prime-counting-function).
previously encountered in Example [Chapter03_02](https://github.com/ckormanyos/real-time-cpp/tree/master/examples/chapter03_02#prime-counting-function).
The prime number theorem known from mathematical number theory
postulates that the prime counting function $\pi(x)$ for large $x$
asymptotically and approximately approaches
Expand Down
8 changes: 4 additions & 4 deletions examples/chapter17_03/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example Chapter17_03

## Traditional C Language Code in a Modern C++ Project

Example chapter17_03 depicts some methods that potentially allow
Expand Down Expand Up @@ -61,13 +62,12 @@ void Crc08_Finalize (Crc08_Context_Type* Crc_Context);
On top of the existing C-language CRC library we have built a skinny
object-oriented C++ wrapper class architecture that
allows the CRC objects to be used effectively in a
modern C++ envorinment. The application benchmark task,
modern C++ environment. The application benchmark task,
for instance, tests all four CRC functions and compares
the results with their expected values. As mentioned in
![Example chapter06_01](../chapter06_01), the standard
[Example chapter06_01](../chapter06_01), the standard
CRC test involves the result of performing the CRC on the
bytes of the ACII digits
<img src="https://render.githubusercontent.com/render/math?math=1{\ldots}9">.
bytes of the ASCII digits $1$ through $9$.

The application task `app::crc::task_func()` is shown below.

Expand Down
3 changes: 2 additions & 1 deletion examples/chapter17_03a/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Example Chapter17_03a

## Traditional C-Language in Modern C++, Using Time Slices

Example chapter17_03a is almost identical with
Expand Down Expand Up @@ -105,7 +106,7 @@ void app::crc::task_func()
// Finalize this CRC object.
app_crc_checksums[app_crc_object_index]->finalize();

// Increment to othe next CRC object in the list.
// Increment to the next CRC object in the list.
++app_crc_object_index;

if(app_crc_object_index >= app_crc_checksums.size())
Expand Down
15 changes: 6 additions & 9 deletions examples/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
<img src="https://github.com/ckormanyos/real-time-cpp/actions/workflows/real-time-cpp-examples.yml/badge.svg" alt="Build Examples"></a>
<a href="https://github.com/ckormanyos/real-time-cpp/blob/master/LICENSE_1_0.txt">
<img src="https://img.shields.io/badge/license-BSL%201.0-blue.svg" alt="Boost Software License 1.0"></a>
<a href="https://godbolt.org/z/fxWzb6h6f">
<a href="https://godbolt.org/z/zbcof9E94">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt"></a>
</p>

These examples are motivated by the book
C.M. Kormanyos,
[Real-Time C++](https://www.springer.com/de/book/9783662629956):
Efficient Object-Oriented
and Template Microcontroller Programming, Fourth Edition
(Springer, Heidelberg, 2021) ISBN 9783662629956.
These examples are motivated by the book C.M. Kormanyos, _Real-Time_ _C++:_
_Efficient_ _Object-Oriented_ _and_ _Template_ _Microcontroller_ _Programming_, _4_$^{th}$ _Edition_
and are made available for educational and exploratory use.

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,
Expand Down Expand Up @@ -140,11 +137,11 @@ in each individual example directory.
## Try it at _godbolt_

<p align="center">
<a href="https://godbolt.org/z/fxWzb6h6f">
<a href="https://godbolt.org/z/zbcof9E94">
<img src="https://img.shields.io/badge/try%20it%20on-godbolt-green" alt="godbolt"></a>
</p>

Use this [short link](https://godbolt.org/z/fxWzb6h6f)
Use this [short link](https://godbolt.org/z/zbcof9E94)
to [godbolt](https://godbolt.org) in order to further explore
Example [chapter02_02](https://github.com/ckormanyos/real-time-cpp/tree/master/examples/chapter02_02)
(the LED program). In the link, the main source file of the example
Expand Down
Loading
Loading