
Extreme Integers – Doom from Below
As a beginner or immediate C++ programmer, you heard never mixing unsigned and signed integer types or avoiding unsigned integers ...

Event-Based Firmware Example
If you read the previous articles about event-based firmware, modularisation and templates, you may wonder how to combine all these ...

Consistent Error Handling
Error handling in firmware is a difficult task. If you decide to ignore errors, the best you can expect is ...

Use Enum with More Class!
You may be familiar with enum values, but do you know about enum classes? This great feature was introduced with ...

C++ Templates for Embedded Code (Part 2)
Templates are a powerful feature of the C++ language, but their syntax can be complex. Here I will continue with ...

Bit Manipulation using Templates
Did you read my article about C++ templates for embedded code? You learned how to use function templates. This post ...

C++ Templates for Embedded Code
Templates are a powerful feature of the C++ language but their syntax can be complex. This causes some developers to ...

Auto and Structured Binding
This article is just a short follow-up article for “Write Less Code using the ‘auto’ Keyword”. Structured binding is something ...

Guide to Modular Firmware
This article is for embedded software developers with a solid working knowledge of C or C++, but who struggle with ...

It’s Time to Use #pragma once
In my opinion, preprocessor macros and the outdated #include mechanism are one of the worst parts of the C++ language ...

Write Less Code using the “auto” Keyword
The auto keyword was introduced with C++11. It reduces the amount of code you have to write, reduces repetitive code ...

Units of Measurements for Safe C++ Variables
In your program code, you often deal with unitless values. You can add the units of measurements in the variable ...

Real Time Counter and Integer Overflow
After writing the article about event-based firmware, I realised there are some misunderstandings about how real-time counters are working and ...

Class or Module for Singletons?
Should you use a class or a module with a namespace for a singleton interface in your firmware? I found ...

Event-Based Firmware (Part 2/2)
In the first part of this series, we explored the general concept of event-based firmware. To read that article, follow ...

Event-based Firmware (Part 1/2)
You start with small, simple firmware. But with each added feature, the complexity grows and grows. Soon, you need a ...

How to Deal with Badly Written Code
Sadly there is a ton of badly written code out in the wild. Hardware related code, seem to suffer more ...

Make your Code Safe and Readable with Flags
Flags play an important role in embedded software development. Microcontrollers and chips are using registers where single bits or combinations ...

How and Why to Avoid Preprocessor Macros
While most naming conflicts in C++ can be solved using namespaces, this is not true for preprocessor macros. Macros cannot ...

How and Why to use Namespaces
Namespaces are a feature of C++ which address the problem of name conflicts. There is a "global" namespace, where everything ...