Ejemplo n.º 1
0
void _sys_setup(char_t* config_file)
{
  if(!config_file){
    WARNINGPRINT("Config file is not defined");
  }else{
    config_load_from_file(config_file);
  }

}
Ejemplo n.º 2
0
int main(int argc, char *argv[]) {
	int i;
	
	UNUSED(argc);
	UNUSED(argv);
	
	signal(SIGINT, sigInt);
	signal(SIGHUP, sigHup);
	
	printf("\nMakeplate linux C example.\n\n\n");

	INFOPRINT("Information printout\n");
	
	DEBUGPRINT("Debug printout\n");
	
	WARNINGPRINT("Warning printout\n");
	
	ERRORPRINT("Error printout\n");
	
	DEBUG_DO(printf("Debug do\n"));
	
	
	i = 0;
	
	printf("Var i = %2x\n", i);
	BIT_SET(i, 4);
	printf("Var i = %2x\n", i);
	BIT_SET(i, 2);
	printf("Var i = %2x\n", i);
	BIT_CLEAR(i,4);
	printf("Var i = %2x\n", i);

	
	printf("Use CTRL-C to stop program\n");
	while(1) {
	}
	
	return 0;
}
Ejemplo n.º 3
0
fsm_states_t _fsm_halt_trans(int32_t event, void *arg)
{
	CMP_DEF_THIS(fsm_t, get_fsm());

	switch(event)
	{
	  case EVENT_SETUP:
	    _cmps_ctor();
	    _sys_setup((char_t*) arg);
	    return STATE_HALT;
	  case EVENT_START:
        _sys_start();
        return STATE_RUN;
	  case EVENT_SHUTDOWN:
        _sys_shutdown();
        _cmps_dtor();
        return STATE_HALT;
	  default:
	    WARNINGPRINT("The event (%s) you required doesn't have transition in the current state (%s)", this->event_str, this->state_str);
	    break;
	}

	return this->current;
}