on 16 April 2013
Real-Time C++: Efficient Object-Oriented and Template Microcontroller Programming.
by Christopher Michael Kormanyos
This is a surprising book, one might say paradigm-shifting.
8-bit micros are normally associated with hardcore assembler, perhaps using C or even C-style-C++,
but this book leapfrogs ahead, without a MACRO in sight, showing how to use the latest C++11 compilers.
Christopher Kormanyos shows how the very latest C++11 features can be used to great advantage on the smallest machines. MACROs throw away type information that the compiler may use to optimise. He shows how using the STL library avoids dodgy DO loops (desirable if the controller is driving your car!) and is well optimised. New lambdas, templates, the new variadic templates, and template metaprogramming are all used to achieve everything possible at compile time, reducing size and boosting speed. All the controller specific register details are well hidden so that code can be crystal-clear. Specified-size types like std::uint8_t are used to ensure that the compiler is certain about the size and type. If you don't have floating-point then fixed-point remains an option. ROMability and other startup initialization of RAM are given detailed treatment.
Full C++11 compilers such as GCC mean that the extensive Boost library [...] is potentially useful, with examples given of using some Boost.Math library special functions and constants.
This book will be of special interest to ATMEL and Arduino project users, but has some useful examples and lessons for users of Raspberry Pi and up. Invaluable practical detail on setting up the compiler, linker and download tools are an outstanding feature.
The only drawback of this nicely produced book is the hardback price.