void option::operator = (const std::vector<std::string> &d) {
		init_multi(d);
	}
예제 #2
0
void setupPulses(unsigned int port)
{
  heartbeat |= HEART_TIMER_PULSES ;
#ifdef REV9E
	SuCount += 1 ;
//	progress( 0xA000 + port + ( SuCount << 4 ) ) ;
//	return ;
#endif
	
	if ( port == 0 )
	{
  	if ( s_current_protocol[0] != g_model.protocol )
  	{
  	  switch( s_current_protocol[0] )
  	  {	// stop existing protocol hardware
  	    case PROTO_PPM:
					disable_main_ppm() ;
  	    break;
  	    case PROTO_PXX:
					disable_pxx(0) ;
  	    break;
	//      case PROTO_DSM2:
	//				disable_ssc() ;
	//      break;
	//      case PROTO_PPM16 :
	//				disable_main_ppm() ;
	//      break ;
  	  }
		
  	  s_current_protocol[0] = g_model.protocol ;
  	  switch(s_current_protocol[0])
  	  { // Start new protocol hardware here
  	    case PROTO_PPM:
					init_main_ppm() ;
  	    break;
  	    case PROTO_PXX:
					init_pxx(0) ;
  	    break;
		    case PROTO_OFF:
					init_no_pulses( INTERNAL_MODULE ) ;
  	  	break;
	//      case PROTO_DSM2:
	//				init_main_ppm( 5000, 0 ) ;		// Initial period 2.5 mS, output off
	//				init_ssc() ;
	//      break;
	//      case PROTO_PPM16 :
	//				init_main_ppm( 3000, 1 ) ;		// Initial period 1.5 mS, output on
	//      break ;
  	  }
  	}

	// Set up output data here
		switch(s_current_protocol[0])
  	{
		  case PROTO_PPM:
  	    setupPulsesPpm();		// Don't enable interrupts through here
  	  break;
  		case PROTO_PXX:
  	    setupPulsesPXX(0);
  	  break;
	//	  case PROTO_DSM2:
	////      sei() ;							// Interrupts allowed here
	//      setupPulsesDsm2(6); 
	//    break;
	//  	case PROTO_PPM16 :
	//      setupPulsesPPM();		// Don't enable interrupts through here
	////      // PPM16 pulses are set up automatically within the interrupts
	////    break ;
  	}
	}
	else
	{
  	if ( s_current_protocol[1] != g_model.xprotocol )
  	{
  	  switch( s_current_protocol[1] )
  	  {	// stop existing protocol hardware
  	    case PROTO_PPM:
					disable_ppm(EXTERNAL_MODULE) ;
  	    break;
  	    case PROTO_PXX:
					disable_pxx(EXTERNAL_MODULE) ;
  	    break;
	      case PROTO_DSM2:
		    case PROTO_MULTI:
					disable_dsm2(EXTERNAL_MODULE) ;
	      break;
#ifdef ASSAN
	      case PROTO_ASSAN :
					disable_assan(EXTERNAL_MODULE) ;
	      break;
#endif
	//      case PROTO_PPM16 :
	//				disable_main_ppm() ;
	//      break ;
  	  }
		
  	  s_current_protocol[1] = g_model.xprotocol ;
  	  switch(s_current_protocol[1])
  	  { // Start new protocol hardware here
  	    case PROTO_PPM:
				  setupPulsesPpmx() ;
					init_ppm(EXTERNAL_MODULE) ;
  	    break;
  	    case PROTO_PXX:
					init_pxx(EXTERNAL_MODULE) ;
  	    break;
		    case PROTO_OFF:
					init_no_pulses( EXTERNAL_MODULE ) ;
  	  	break;
	    	case PROTO_MULTI:
					init_multi(EXTERNAL_MODULE) ;
					DsmInitCounter = 0 ;
					pass_x = 0 ;
  	  	break;
	      case PROTO_DSM2:
					init_dsm2(EXTERNAL_MODULE) ;
					DsmInitCounter = 0 ;
					pass_x = 0 ;
	      break;
#ifdef ASSAN
	      case PROTO_ASSAN :
					init_assan(EXTERNAL_MODULE) ;
	      break;
#endif
	//      case PROTO_PPM16 :
	//				init_main_ppm( 3000, 1 ) ;		// Initial period 1.5 mS, output on
	//      break ;
  	  }
  	}

	// Set up output data here
		switch(s_current_protocol[1])
  	{
		  case PROTO_PPM:
  	    setupPulsesPpmx();		// Don't enable interrupts through here
  	  break;
  		case PROTO_PXX:
  	    setupPulsesPXX(1);
  	  break;
		  case PROTO_DSM2:
	    case PROTO_MULTI:
	//      sei() ;							// Interrupts allowed here
      	setupPulsesDsm2( ( g_model.xsub_protocol == DSM_9XR ) ? 12 : 6 ) ; 
//	      setupPulsesDsm2(6); 
	    break;
#ifdef ASSAN
	    case PROTO_ASSAN :
	      setupPulsesDsm2( 12 ) ;
//	      setupPulsesDsm2(g_model.xppmNCH) ; 
	    break;
#endif
	//  	case PROTO_PPM16 :
	//      setupPulsesPPM();		// Don't enable interrupts through here
	////      // PPM16 pulses are set up automatically within the interrupts
	////    break ;
  	}
	}
}
	//옵션 리스트를 array형태로 받아들입니다. ex) testa({"asd", "123"});
	option::option(const std::vector<std::string> &d){
		init_multi(d);
	}