#include "ExampleSimpleData.h"
#include "../result/exampleSimpleStates.h"  //a generated file.
#include <stdio.h>




void stepState(ExampleSimpleData* stateData)
{

  int step;
  int event;
  for(step = 0; step < 20; ++step) {
    switch(step){  //stimuli in any step time:
      case 1: stateData->start = true; stateData->on_ready = true; break;
      case 2: offer_EventQueueSimple_Fwc(&stateData->eventQueue, kStart_Event_ExampleSimple); break;
      case 8: stateData->bit_a = 0; break;
    }//switch
    stepStateTimer_State_ExampleSimpleData( stateData, 0 );
    event = read_EventQueueSimple_Fwc(&stateData->eventQueue);
    printf("\n%d;", step);
    stepStates_State_ExampleSimpleData( stateData, event );
  } //for

}


void stateError(char const* text, int nrStateFaulty)
{
  printf("State error %s: %d\n", text, nrStateFaulty);
}


void main(const char** args)
{
  //Instance in stack for test. Elsewhere maybe static or allocated.
  ExampleSimpleData stateData = {0};
  //Initializing of the instance, constructor:
  ctor_EventQueueSimple_Fwc(&stateData.eventQueue, 0);
  stateData.delay = 5;
  //Testroutine.
  stepState(&stateData);

}



