Closed FintasticMan closed 10 months ago
Build size and comparison to main: | Section | Size | Difference |
---|---|---|---|
text | 409268B | 0B | |
data | 996B | 0B | |
bss | 63356B | 0B |
I've just pushed a change that switches NotificationManager to use this new CircularBuffer. IMO it makes the code easier to understand from a glance.
Maybe a static sized vector class is more along the lines of what we need for NotificationManager, along with a helper function that will erase the oldest entry if pushing a new element wouldn't fit otherwise.
See #1712
Merged with #826.
Implements a simple circular buffer template.
buf[0]
is the value at the current index. You can use the++
and--
operators to move the index. You can initialise the buffer using aggregate initialisation, meaning you can just initialise with a curly-brace list.