LennartHennigs / SimpleFSM

Arduino/ESP library to simplify setting up and running a state machine.
MIT License
69 stars 16 forks source link

Issue with timedTransitions using PlatformIO #3

Closed gsicilia82 closed 1 year ago

gsicilia82 commented 1 year ago

I was looking for a FSM with best user interface, and I really like yours. After some tests with your examples, by compiling with PlatformIO, I encountered an issue:

(To be clear: everything works well with Arduino-IDE! I don't understand this different behaviour with PlatformIO)

Usually, the code line fsm.add(timedTransitions, num_timed); lets crash my esp32:

image

Sometimes, the code is running fine until first hardware reset. After first reset, each program start ends up with same crash.

There is one exception about the crash: Adding timedTransitions after adding standard transitions works well. Working with standard transitions works always.

This crashs my esp32

  fsm.add(timedTransitions, num_timed);
  fsm.add(transitions, num_transitions);

This works well

  fsm.add(transitions, num_transitions);
  fsm.add(timedTransitions, num_timed);

Do you have any idea?

I am working with PlatformIO on different projects, usually it doesn't matter if compiling with PIO or Arduino-IDE. I want to use your FSM in my next project, therefore, I would like to know about this strange behaviour.

Thank you.

gsicilia82 commented 1 year ago

Issue is solved with version v1.2.0!

Unfortunately, v1.0.0 is the latest distributed version within PlatformIO. I don't know how, but pulling your lib officially to v1.2.0 in pio library could help other users. I have added your lib with direct github link; know it shows v1.2.0.

Thank you. You can close this issue.

LennartHennigs commented 1 year ago

Hey, thanks for reaching out. And thank you for pointing out that the version is not on platform.io. That's strange. Will check it out.

And I am glad you like the lib. Wasn't also happy with most others back then. That's why I built this one. 😃

lewsut commented 1 year ago

still v1.0.0 on platformIO

LennartHennigs commented 1 year ago

Hey, thanks for pointing it out. Just published the new recent version to PlatformIO.