Sunday, December 17, 2023
C++ allows declaring functions as constexpr
. Such functions could be evaluated at compile time and used, for example in if constexpr(...)
. However, a non-constexpr function in this context is not allowed.
So, if we want to write a template, accepting a function and using it in either if constexpr(...)
or old plain if(...)
we need to test whether the function is constexpr, otherwise compile fails as illustrated below:
(Continued)
C++ does not allow using string literals as case values in a switch statement. In modern C++ this restriction can be worked around with constexpr hash values.
(Continued)
This simple C++17 template implements constexpr any_of
for matching a value against a list of constants.
(Continued)
COJSON library is also available as Arduino Studio .ZIP library: cojson.zip.
(Continued)
Filed in cojson
|
Tagged Arduino, ARM, ATmega, avr, C++, Cortex-M0, Cortex-M4, embedded, embedded systems, json, JSON for embedded systems, json parser, json serializer, low end MCU, MCU
|
C++17 has simplified use of template parameters. Instructions, given in this tutorial, describes how to define
JSON model with cojson::autos templates.
Note: GCC 7 or higher is required to compile cojson_autos.hpp !
(Continued)
cojson v.2 offers an easy start option by using C++ code automatically generated from a JSON sample the user needs to parse or to write.
To use this option just open codegen page, load or copy-&-paste your JSON and copy-&-paste or save the generated C++ code.
And then build your application with cojson sources .
(Continued)
Filed in cojson
|
Tagged Arduino, ARM, ATmega, avr, C++, cojson, embedded systems, json, JSON for embedded systems, json parser, json serializer, low end MCU, MCU
|
Saturday, October 6, 2018
PSoC — Programmable System on Chip - is an ARM Cortex based family of MCUs
(wiki) by Cypress Semiconductor.
Cypress offers developers a dedicated IDE - PSoC Creator. Unfortunately, PSoC Creator, (as of version 4.2) does not support
C++, despite the underlying GGC Toolchain (arm-none-eabi-gcc-5.4) has C++ support at descent level.
PSoC Creator has an option for migrating to Eclipse CDT IDE, however, migrated projects has no C++ support either
This post explains how to enable C++ for PSoC projects, imported in Eclipse CDT IDE.
(Continued)
Wednesday, September 5, 2018
This post describes how to build OpenSplice DDS for LinkIt Smart 7688 and other OpenWRT targets
Overview
USB++
(usbplusplus) is a C++14 template library that gives the user a simple and error-prone way for defining USB descriptors, suitable for embedded projects.
(Continued)