Welcome to the thinStates web site

Introducing the thinStates C Compiler for StateWORKS

The complete article as pdf: here
The downloadable example, which runs on an Olimex LPC-P2148 development boardhere

The thinStates C Compiler for StateWORKS brings the StateWORKS' idea of an executable specification, to the microcontroller level.

After properly modeling the “abstraction layer” between the microcontroller board resources and the used StateWORKS objects, the user will be able to execute the specification with a minimal amount of memory.

The generated code is very human-readable, and it is easy to debug, because of the instance-to-c-file translation strategy.

Generation Technique

The key concept in thinStates code generation, is the generation of a .c file for each VFSM instance.

For example, if we define just only one State Machine in SWStudio (e.g. Button) and then we instantiate it two times (e.g. Button_1 and Button_2), we get two .c files: swc_vfsm_Button_1.c and swc_vfsm_Button_2.c.

In fact, the two .c files look very similar, but the object names they refer to are different: each one statically refers to the objects that that instance is connected to, in SWStudio.

In our experience, this approach produces the most human-friendly (and fast, as well) source code: it is simple to read, and simple to debug: we can put a breakpoint when a particular instance of state machine changes its state, and inspect the relevant variables if needed, to understand an issue that happens on a single instance.

Read more about StateWORKS, give it a try

StateWORKS Site is full of articles, and contains a download section for 30-day evaluations.
Go here also, if you want to know more about the author of thinStates.