GithubHelp home page GithubHelp logo

Comments (8)

digint avatar digint commented on May 30, 2024

Thanks for reporting!

I forgot how painful it is to work with crippled compilers (I guess you have some AVR compiler or similar?)...

Here's a fix:

  • 9bcf2ac: add tinyfsm::is_state_of<F,S> type trait (abstraction for static asserts
  • 2bf67f5: remove extraneous static asserts on transit functions; add asserts on illegal state
  • e0f40ac: add TINYFSM_NOSTDLIB compile option (disable static asserts)

This is currently on nostdlib branch: could you please make a quick review and give me a feedback before I merge it?

from tinyfsm.

niliopoulos avatar niliopoulos commented on May 30, 2024

The nostdlib branch compiles and runs properly with AVR toolchain now.

Thanks!

from tinyfsm.

digint avatar digint commented on May 30, 2024

Thanks for testing! can you provide me a link to the AVR toolchain you are using?

from tinyfsm.

niliopoulos avatar niliopoulos commented on May 30, 2024

Of course,
It is this one:
http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/3.4.3/
I inspected the distribution structure a bit and did find experimental features that can enable type_traits but didn't test it. Maybe it is time for us to move to a newer version anyway though.

from tinyfsm.

digint avatar digint commented on May 30, 2024

Thanks for the link! I found type_traits in:
http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/3.4.3/avr-gcc-4.8.1.tar.gz

# find -name type_traits
[...]
./gcc/libstdc++-v3/include/std/type_traits

It's part of the "type support library", so simply including it should probably work . This is all compile-time stuff and can come in very handy, especially in embedded environments.
Something like this (+probably some dependencies):

gcc -isystem /opt/toolchain/avr/gcc/libstdc++-v3/include/std

See my fancy stuff in: "OpenMPTL - C++ Microprocessor Template Library", especially the stm32f103stk-demo which also uses tinyfsm:

https://github.com/digint/openmptl/tree/master/projects/stm32f103stk-demo/src

@niliopoulos : I'd love to have a little AVR example in TinyFSM. Do you have something you could contribute here? e.g. a basic example with Makefile using the AVR toolchain.

from tinyfsm.

niliopoulos avatar niliopoulos commented on May 30, 2024

We were looking for OpenMPTL functionality a few months back but we got carried away by higher level stuff. I really like the interface and will try to play with it when we are again at the lower level cycle of development.

Regarding the example, we are currently working on the implementation of an NFA that we expect to publish in the next year and will make sure we give proper credit because without tinyfsm, development, debugging and maintenance would be a nightmare. I am not sure we will publish the code though. What we found interesting is that really the only item that needed to be different from the tinyfsm examples is that the external events are based either on polling or on interrupt callbacks.

from tinyfsm.

digint avatar digint commented on May 30, 2024

Regarding the example, we are currently working on the implementation of an NFA that we expect to publish in the next year and will make sure we give proper credit because without tinyfsm, development, debugging and maintenance would be a nightmare.

Well thanks for the credits, tt's always nice to see people finding my stuff useful!

What we found interesting is that really the only item that needed to be different from the tinyfsm examples is that the external events are based either on polling or on interrupt callbacks.

Yes, that's exactly why higher level event dispatching is explicitely not part of tinyfsm. I've used it with interrupts (some low-level SPI), also in conjunction with event queues: basically a scheduler which also generates events by polling. This all was very straight forward, and as long as you don't code braindead things, TinyFSM just works for me.

from tinyfsm.

digint avatar digint commented on May 30, 2024

This is now included in TinyFSM-v0.3.2, closing issue.

from tinyfsm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.