Beispiel #1
0
int nsh_archinitialize(void)
{
	printk("%s\n", __func__);

	/* Power ON the switch and bridges upon boot */
	switch_control(1);

	return OK;
}
/**
 * Checks for init
 * return 0 if the command was "init"
 */
int check_for_init(void){
  if(veh.server_reply[0] == 'i'){
    if (veh.state == VEH_UNINIT) {
      // init vehicle
      printf("**************************************************\n");
      printf("I AM INITIALIZING THE VEHICLE\n");
      printf("I WILL INITIALIZE IN 2 STAGES\n");
      printf("THIS CAN TAKE UP TO 30 SECONDS\n");
#if !DEBUG
      init_wings(); // MUST BE DONE AT LEAST ONCE AFTER A RESET DEVICE
#endif
      printf("PREPARING TO A CONTROL SWITCH ROUTINE\n");
#if !DEBUG
      sleep(3);
      switch_control();
#endif
      printf("PREPARING TO RETURN CONTROL SWITCH ROUTINE\n");
#if !DEBUG
      sleep(3);
      switch_control();
#endif
      printf("SLOW START INITIALIZATION COMPLETED\n");
      printf("**************************************************\n\n");
      veh.state = VEH_INIT;
    }
    else {
      printf("**************************************************\n");
      printf("Already initialized.\n");
      printf("**************************************************\n");
    }
    // prepare response
    sprintf(veh.message, "%s", init);

    // command found
    return 0;
  }
  else {
    // continue search
    return 1;
  }
}
Beispiel #3
0
void MapLayer::LoadBattle(Script* ascp){

	m_iMLState = 2;				// <TODO | EMERGENT | 使用脚步进行初始化 [START] 将轮转开始交给接口控制,同时将镜头控制纳入脚本接口(f_setcamera || 已实现)
	if(wm){
		wm->setVisible(false);
		wm->f_state_circle(false);
		wm->DeActive();

		show_hud();

		f_pauseall();
		f_stopcontrol();
	}

	const char* pszN = ascp->getstring("map");
	int i_egr = 0;				// <调试用|载入地图 | 逻辑统一后进行修改
	if(bm){
		bm->removeFromParent();
		CC_SAFE_RELEASE_NULL(bm);
	}
	bm = new BattleMap(pszN);

	bm->f_generateEnemy(i_egr);
	bm->f_load_chara();
	bm->PlaceEChesses(ascp);
	BattleField::sharedBattleField()->InitBattleFiled();	 
	bm->init();

	addChild(bm,BM_Z);
	tm = bm;
	f_init_battle();
	bm->EnActive();

	m_Spliter->f_open();
	m_Spliter->ShowClock();

	bm->cancontrol = true;
	init_Stat();

	BattleField::sharedBattleField()->InitBF();
	m_iTurn = ascp->getint("turn");
	switch_control();
}