Beispiel #1
0
int main(void)
{
    // Initialize BRTOS
    BRTOS_Init();
    ////////////////////////////////////////////////////////

    // Cria um gerenciador de eventos p/ dados acelerômetro
    if (OSMboxCreate(&Data, NULL) != ALLOC_EVENT_OK)
    {
        // Oh Oh
        // Não deveria entrar aqui !!!
        while(1) {};
    };

    if(InstallTask(&System_Time,"System Time",384,31,NULL,NULL) != OK)
    {
        // Oh Oh
        // N�o deveria entrar aqui !!!
        while(1) {};
    };

    if(InstallTask(&Test_Task_1,"Tarefa de Teste 1",384,13,NULL,NULL) != OK)
    {
        // Oh Oh
        // N�o deveria entrar aqui !!!
        while(1) {};
    };

    if(InstallTask(&Test_Task_2,"Tarefa de Teste 2",384,14,NULL,NULL) != OK)
    {
        // Oh Oh
        // N�o deveria entrar aqui !!!
        while(1) {};
    };

    if(InstallTask(&SerialTask,"Tarefa Serial",512,10,NULL,NULL) != OK)
    {
        // Oh Oh
        // N�o deveria entrar aqui !!!
        while(1) {};
    };

    // Start Task Scheduler
    if(BRTOSStart() != OK)
    {
        // Oh Oh
        // N�o deveria entrar aqui !!!
        for(;;) {};
    };

    // Infinite loop
    while (1)
    {
    }
    // Infinite loop, never return.
}
Beispiel #2
0
int main(void)
{
  // Init your system clock here

  // Initialize BRTOS
  BRTOS_Init();

  if(InstallTask(&exec,"Teste 1",384,3,&th1) != OK)
  {
    // Oh Oh
    // Não deveria entrar aqui !!!
    while(1){};
  };


  if(InstallTask(&exec2,"Teste 2",384,5,&th2) != OK)
  {
    // Oh Oh
    // Não deveria entrar aqui !!!
    while(1){};
  };

  if(InstallTask(&exec3,"Teste 3",384,10,&th3) != OK)
  {
    // Oh Oh
    // Não deveria entrar aqui !!!
    while(1){};
  };


  // Start Task Scheduler
  if(BRTOSStart() != OK)
  {
    // Oh Oh
    // Não deveria entrar aqui !!!
    for(;;){};
  };

  return 0;
}
Beispiel #3
0
void main(void) 
{

  #if(BOOTLOADER_ENABLE == 1)
    ISR_vtable_reallocation();
  #endif  

  MCU_init(); /* MCU Initialization */   
  
  // Initialize BRTOS
  BRTOS_Init();  
  
  /* Peripheral inicialization */
#if (DEBUG == 1) 

  /* flash clock for reprogramming */ 
  Flash_Clock_Init();     
  
  /* Initialize A/D Converter and bandgap reference */
  ADC_Setup(HighSpeed, ShortSampleTime, 12);
  if(ADC_Bandgap_Set() != BANDGAP_OK){
    while(1){}
  }
 
#endif    
  
  
  #if(DEBUG == 1)    
  #if(NETWORK_ENABLE == 1)     
  
  GPSNET_Init();     
  
  if(InstallTask(&GPSNET_RxApp,"GPSNET RX task",320,APP3_Priority) != OK)
  {
    while(1){};
  }
  /*
  if(InstallTask(&GPSNET_TxApp,"GPSNET TX task",1280,APP2_Priority) != OK)
  {
    while(1){};
  }
  */
  
  if(InstallTask(&GPSNET_SensorApp,"GPSNET Sensor task",1280,APP1_Priority) != OK)
  {
    while(1){};
  }
    

  #endif   
  #endif
  
     
  if(InstallTask(&System_Time,"System Time",320,System_Time_Priority) != OK)
  {
    while(1){};
  };
  
  if(InstallTask(&Comm2PC_Task,"Comm2PC task",448,Comm2PC_Task_Priority) != OK)
  {
    while(1){};
  };    
  
  
  if(InstallTask(&HeartBeat_LED_Task,"HeartBeat LED task",320,HeartBeat_LED_Priority) != OK)
  {
    while(1){};
  };
    

  // Start Task Scheduler
  if(BRTOSStart() != OK)
  {
    while(1){};
  };  



  for(;;) {
    /* __RESET_WATCHDOG(); by default, COP is disabled with device init. When enabling, also reset the watchdog. */
  } /* loop forever */
  /* please make sure that you never leave main */
}