Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I was inspired by the great copperspice library libguarded and wanted something similar for when I have to go back to micro's and FreeRTOS. The basic idea of the library is to prevent access to a shared data structure unless the mutex lock associated with it is also acquired. This is to prevent situations where someone forgets to get the lock before reading or writing to shared memory.
To make this work you also need a small wrapper class around a mutex that provides the lock and unlock functions. Here is a quick one that works or the freertos-addons library has a good implementation.