Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

building for embedded targets #36

Open
SergeTauger opened this issue Jul 30, 2021 · 1 comment
Open

building for embedded targets #36

SergeTauger opened this issue Jul 30, 2021 · 1 comment

Comments

@SergeTauger
Copy link

Could you please provide a hint on how to build for AVR or STM32? Cmakelists in demo folder have set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") string. Is it enough to add platform-dependent headers, throw away pthreads and add
if(dispatch_event(State_Machines, 1) == EVENT_UN_HANDLED){...} to firmware infinite loop?

@kiishor
Copy link
Owner

kiishor commented Jul 31, 2021

Hi Sergey,

I haven't used cmake to generate a build for any embedded platform. Anyway, you don't need pthread to use the state machine framework. In the demo, it is a way to simulate an interrupt to generate events for the framework on windows OS.

Hence, you can remove pthread and add if(dispatch_event(State_Machines, 1) == EVENT_UN_HANDLED){...} to firmware infinite loop. Use interrupts to generate events for the state machine framework. The framework contains only two files hsm.c & hsm.h. It is platform & OS independendent.

If you need further support on how to use this framework for the embedded platform, feel free to share your repository (or create a demo repo).

Regards,
Nandkishor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants