This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

concurrent state implementation in 51

Hi, all

This topic is a little different from C51. I still hope that someone can help me. Thanks!

A lot of signals will come into my firmware, and the firmware do approprate action based on its state and receiveing event. So there are several concurrent state machine.

My possible solution is use several global variables to store states. Is there any other better solution?

Second, as there is a large number of incoming events, how can i identify those events quickly? Any suggestion?

Thanks!

Parents
  • "there are several concurrent state machine. My possible solution is use several global variables to store states. Is there any other better solution?"

    Unless all your state machines need access to each other's states, don't make them global.
    Try 'static' instead.

    "how can i identify those events quickly?"

    Without knowing the nature of the events, and how they get into your system, it's hard to say!

Reply
  • "there are several concurrent state machine. My possible solution is use several global variables to store states. Is there any other better solution?"

    Unless all your state machines need access to each other's states, don't make them global.
    Try 'static' instead.

    "how can i identify those events quickly?"

    Without knowing the nature of the events, and how they get into your system, it's hard to say!

Children
No data