text: // This file has been automatically generated by goFB and should not be edited by hand
  // Compiler written by Hammond Pearce and available at github.com/kiwih/goFB
  
  // This file represents the implementation of the Basic Function Block for SifbIntLed
  #include "FB_SifbIntLed.h"
  
  
  /* SifbIntLed_preinit() is required to be called to 
   * initialise an instance of SifbIntLed. 
   * It sets all I/O values to zero.
   */
  int SifbIntLed_preinit(SifbIntLed_t  *me) {
  	
  
  	//reset the input events
  	me->inputEvents.event.i_change = 0;
  	
  	
  	//set any input vars with default values
  	
  	//set any output vars with default values
  	
  	//set any internal vars with default values
  	
  	
  	
  	
  	
  
  	
  	
  	//if this is a BFB/odeFB, set start state so that the start state is properly executed and _trigger if necessary
  	// me->_state = STATE_SifbIntLed_Start;
  	// me->_trigger = true;
  	
  	
  	
  
  	
  
  	return 0;
  }
  
  /* SifbIntLed_init() is required to be called to 
   * set up an instance of SifbIntLed. 
   * It passes around configuration data.
   */
  int SifbIntLed_init(SifbIntLed_t  *me) {
  	//pass in any parameters on this level
  	
  	
  	
  
  	//perform a data copy to all children (if any present) (can move config data around, doesn't do anything otherwise)
  	
  	
  	
  
  	//if there are fb children (CFBs/Devices/Resources only), call this same function on them
  	
  	
  
  	return 0;
  }
  
  
  
  //algorithms
  
  void SifbIntLed_update_led(SifbIntLed_t  *me) {
  //PROVIDED CODE: this algorithm was provided in an algorithm's text field
  LED = me->i;
  }
  
  
  
  /* SifbIntLed_run() executes a single tick of an
   * instance of SifbIntLed according to synchronous semantics.
   * Notice that it does NOT perform any I/O - synchronisation
   * will need to be done in the parent.
   * Also note that on the first run of this function, trigger will already be set
   * to true, meaning that on the very first run no next state logic will occur.
   */
  void SifbIntLed_run(SifbIntLed_t  *me) {
  	//if there are output events, reset them
  	
  	
  	
  	
  
  	
  	// //next state logic
  	// if(me->_trigger == false) {
  	// 	switch(me->_state) {
  	// 	case STATE_SifbIntLed_Start:
  	// 		if(me->inputEvents.event.i_change) {
  				
  	// 			me->_state = STATE_SifbIntLed_Update;
  	// 			me->_trigger = true;
  	// 		};
  	// 		break;
  	// 	case STATE_SifbIntLed_Update:
  	// 		if(me->inputEvents.event.i_change) {
  				
  	// 			me->_state = STATE_SifbIntLed_Update;
  	// 			me->_trigger = true;
  	// 		};
  	// 		break;
  		
  	// 	default: 
  	// 		break;
  	// 	}
  	// }
  
  	//state output logic
  	// if(me->_trigger == true) {
  	// 	switch(me->_state) {
  	// 	case STATE_SifbIntLed_Start:
  	// 		#ifdef PRINT_STATES
  	// 			printf("SifbIntLed: [Entered State Start]\n");
  	// 		#endif
  			
  	// 		break;
  	// 	case STATE_SifbIntLed_Update:
  	// 		#ifdef PRINT_STATES
  	// 			printf("SifbIntLed: [Entered State Update]\n");
  	// 		#endif
  			SifbIntLed_update_led(me);
  			
  	// 		break;
  		
  	// 	default: 
  	// 		break;
  	// 	}
  	// }
  
  	// me->_trigger = false;
  
  	
  
  	//Ensure input events are cleared
  	me->inputEvents.event.i_change = 0;
  	
  }
  
  
  