May 2020
Intermediate to advanced
496 pages
13h 54m
English
Since a queue will make a copy of whatever it is holding, if the data structure being queued is large, it will be inefficient to pass it around by value:
So, when there are large items that need to be queued, passing the items by reference is a good idea. Here's an example of a larger structure. After the compiler pads out this struct, it ends up being 264 bytes in size:
mainQueueCompositePassByReference.c:
#define MAX_MSG_LEN 256typedef struct{ uint32_t redLEDState : 1; uint32_t blueLEDState : 1; uint32_t greenLEDState : 1; uint32_t msDelayTime; ...