Esempio n. 1
0
int main( int argc, char *argv[] ){

    Read_options( argc, argv );

    /* Initialize the log error services. */
    RPGC_init_log_services( argc, argv );

    /* Specify inputs and outputs. */
    RPGC_reg_io( argc, argv );

    /* Tell system we are radial-based. */
    RPGC_task_init( RADIAL_BASED, argc, argv );

    CR_combine_init (Range_only, Azi_only, Index_azimuth);

    /* Waiting for activation. */
    while(1){

        RPGC_wait_act( WAIT_DRIVING_INPUT );
        Process_data ();
    }
}
Esempio n. 2
0
int main( int argc, char *argv[] ) {

/*    int est_sys_phi;*/
/*    int rda_value;*/
#ifdef DPPREP_TEST
    /* DPPL_test (); */
    Test_process_radial (argc, argv);
    exit (0);
#endif

    Read_options (argc, argv);

    /* Initialize the log error services. */
    RPGC_init_log_services( argc, argv );

    /* Specify inputs and outputs. */
    RPGC_reg_io( argc, argv );

    /* Tell system we are radial-based. */
    RPGC_task_init( RADIAL_BASED, argc, argv );

    /* Data needed to determine when to output the estimated system PhiDP message. */
    Current_time = time( NULL );
    Current_hour = Current_time / SECS_IN_HOUR;
    Previous_hour = Current_hour;

    /* Read in any previous Bragg scatter data */
    Read_Bragg_data ();

    /* Waiting for activation. */
    while(1){

        RPGC_wait_act( WAIT_DRIVING_INPUT );
        Process_data ();

    }
}
Esempio n. 3
0
// ----------------------------------------------------------------------------------------------
//  M A I N
// ----------------------------------------------------------------------------------------------
void main(void)
{   
    
   port_init(); 
    timer0_init();
   timer0_Delay(1000);
   SPI_masterInit(); 
   LED_RUN_ON;
   LED_ERROR_ON;
  
   CAN_Init(CAN_PARAMS,  CAN_BAUD_500);  
   CAN_setAcceptFilter(CAN_PARAMS, 2, 0x200);
   LED_ERROR_OFF;
   timer0_Delay(1000);
   
  can_msg_out.ID = 0x100;


  can_msg_out.DLEN = 2;

  //рабочий цикл
  while(1)
  { 
  //-------------------------------------
  // собираем пакет
  packages();
  
  //------------------------------------------------------
   //Посылаем пакет
   if ( (timer0_getCounter() - hbit) > 200) { CAN_Msg_Send(CAN_PARAMS,&can_msg_out); hbit = timer0_getCounter(); LED_RUN_SWITCH; }
   
   //Получаем КАН сообщение
   if (CAN_msg_Read(CAN_PARAMS, &can_msg_in)) 
    { 
	 //Обнуляем флаг ошибки
	 if (err_flag) {LED_ERROR_OFF; err_flag = 0;}
	 //Обрабатываем
	 Process_data(); 
	 //Запоминаем, когда последний раз получили	  
	 timestamp1 =  timer0_getCounter();
	}
 
   //если не получили, проверяем тайм аут
   if ( (timer0_getCounter() - timestamp1) > MAX_timeout )
   {
       err_flag = 1;
	
	   //смотрим, горит ли error
	   //если не горит - включаем и запоминаем когда включили
		
		if ( (timer0_getCounter() - timestamp2) > timeout) 
		  if ( (PORTD & BIT(6)) )
		   {
		    LED_ERROR_ON; 
			B1LED_ON;
			B2LED_ON;
		    timestamp2 = timer0_getCounter();
		    if (!kolvo) {timeout = 600;}
			 else 
			  {timeout = 500; }
		   }
		   else
		   {
		    LED_ERROR_OFF;
			B1LED_OFF;
			B2LED_OFF; 
			timestamp2 = timer0_getCounter();
		    if (kolvo) {timeout = 600;kolvo=0;}
			 else 
			  {timeout = 500;kolvo=1; }
		   }
		   
		   
	  } 
 }
}