4 ms·
> Function pointers as state machines has been a favorite trick of mine for very embedded C stuff. Each function sets the next state function. This is the basi
by arinlen 4y ago
> Function pointers as state machines has been a favorite trick of mine for very embedded C stuff. Each function sets the next state function.
This is the basis of OO's State pattern.
https://en.wikipedia.org/wiki/State_pattern https://en.wikipedia.org/wiki/State_pattern