5.7 AND-States

The last two patterns in the chapter will deal with the implementation of AND-states. For these patterns, we’ll use the state machine from Figure 5-7 as the example state machine with AND-states and we’ll add a few actions to make it more “real.” Figure 5-20 shows the example state machine we will demonstrate with the pattern.

Image

Figure 5-20 AND-state machine used for example case

The semantics of AND-states is that they are “logically concurrent.” This means that in some sense they execute simultaneously, but what does that mean in a world of run-to-completion semantics? If two AND-states process different events, then AND-states ...

Get Design Patterns for Embedded Systems in C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.