Skip to content

Application Notes & Articles ​

Application Notes ​

Application Notes authored at Quantum Leaps, sorted by category.

State-Machine Design Patterns ​

  • Ultimate Hook
    Provide common look-and-feel, but let clients specialize every aspect of a system's behavior.
  • Reminder
    Provide more flexibility by inventing an event and posting it to self
  • Deferred Event
    Control the sequence of events
  • Orthogonal Component
    Use state machines as components of other state machines
  • Transition to History
    Transition to the most recent state configuration of a given composite state
  • State-Local Storage
    Reduce memory footprint of state machines by introducing the state-local variable scope

Programming Techniques ​

Example Applications ​

QP™ Ports (Built-in Kernels) ​

QP™ Ports (3rd-Party RTOS) ​

QP™ Ports (General-Purpose OSes) ​

QP™ Ports (3rd-Party Middleware) ​

Prototyping / Dual Targeting ​

QP™ Performance Tests and Results ​

Articles ​

Relevant and recommended articles written by various authors, sorted by category.

Active Objects (Actors) ​

Hierarchical State Machines (UML Statecharts) / Modeling ​

Event-Driven & Real-Time Programming ​

"The Embedded Angle" Column (C/C++ Users Journal) ​

  • The Embedded Mindset — Miro Samek · CUJ, February 2003↑
    The proliferation of embedded systems means ever-increasing demand for firmware. Developing embedded code, however, takes significantly more than just learning a new API — it requires adapting an entirely new mindset. You can still use C or even C++, but beware: many time-honored techniques from the desktop can hurt you.
  • Who Moved My State? — Miro Samek · CUJ, April 2003↑
    Just as the mice and little-people from the Spencer Johnson's little story 'Who Moved My Cheese?', we programmers use different strategies to find our favorite kind of 'Cheese': robust, adaptable, and maintainable software. Interestingly, techniques based on hierarchical state machines aren't among the popular, mainstream programming strategies. Yet, state machines are perhaps the most effective method of all for developing robust event-driven code, because they give us the map to the software maze — the blueprint of all the states of the system at any given time. If you don't use state machines today, you'll likely use them tomorrow.
  • Déjà Vu — Miro Samek · CUJ, June 2003↑ · PELICAN crossing example is included in QP/C++
    I hope that you experience a strange feeling of déjà vu when you read about programming-by-difference, inheritance, guaranteed initialization and cleanup, and the Liskov Substitution Principle (LSP) in the context of hierarchical state machines (HSMs). Such a close analogy between the fundamental concepts of OOP and HSMs is truly remarkable. Indeed, the analogy adds another dimension to the OOP. The traditional OO method seems to stop short at the boundary of a class, leaving the internal implementation of individual class methods to mostly procedural techniques. The concept of behavioral inheritance goes beyond that frontier. It allows applying the OO concepts inside reactive classes.
  • An Exception or a Bug? — Miro Samek · CUJ, August 2003↑
    If you were to single out just one most effective programming technique for delivering high-quality code, what would you choose? Object-oriented programming? Generic programming? Design patterns? Software components? Frameworks? UML? CASE tools? I don't know if these suggestions would top your list, but I suppose that not many programmers would pick assertions (or more scientifically, Design by Contract) as the single most effective programming technique. Yet, if I were to search my soul, I'd have to admit that none of the aforementioned techniques (not even my favorite hierarchical state machines) has helped me as much as the consistent use of assertions. In this installment of 'The Embedded Angle', I try to explain the Design by Contract philosophy, what can it do for you, and why, I think, embedded systems programmers should care.
  • Patterns of Thinking — Miro Samek · CUJ, October 2003↑
    I'm sure that you have used system metaphors, concept metaphors, or 'naive psychology' before, but perhaps you didn't fully realize the fact. I hope that this article will make you more aware of the different roles metaphors and analogies can play in software development, and that there is more to it than just the venerable system metaphor. I hope that you start paying more attention how you and others use metaphors with the goal of making better use of the natural god-given abilities built into your brain. I hope that you start thinking more about metaphors, learn their limits, and remember their critical aspects. Perhaps you will start collecting metaphors?
  • Back to Basics — Miro Samek · CUJ, December 2003↑
    My preoccupation in this installment is with state machine fundamentals and some very straightforward programming guidelines for coding state machines in C or C++. I hope that the simple techniques could become more common, so that you (and others) can readily see the state machine structure right from the source code.