Author Topic: Code generation in C with State Machine  (Read 10485 times)

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Code generation in C with State Machine
« Reply #15 on: April 13, 2010, 08:08:22 pm »
Hi Heero,

Sorry for I'm getting into this discussion, when everything seems to be solved for you already. Since you're mentioning that C should be the final output for the generated code, I'm guessing you have to deploy your FSM on a fairly limited target (restricted RAM and ROM resources)?!?

There was another approach mentioned here on the forum., not to directly generate the target languages code but to generate SMC intermediate code for the FSM and produce the final C code using the SMC-ompiler. The SMC input language allows a much better control over certain FSM features, and the templates are more flexible and easier to understand than EA's code generation templates.

If you'd like to have more details about this approach, and why it might be the better choice for you, feel free to contact me.

You may also contact 'wowbagger' who published the SMC approach here a while ago, search for it in the forum articles.

WBR
günther

HorstKargl

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Code generation in C with State Machine
« Reply #16 on: May 04, 2010, 08:20:40 pm »
Hi,

EA comes with two different Code Templates for C. One for object oriented and one for "normal". You cannot see the differences in the Code Generation Template selection, but the Templates are different.

To use object oriented support for C, set "object oriented support  to true". This can be set in Tools | options | source code engineering.

... you can also adapt the C template for object oriented support to your need.

Best Regards,
Horst