void CFE_TIME_TaskMain(void)
{
    int32  Status;
  
    CFE_ES_PerfLogEntry(CFE_TIME_MAIN_PERF_ID);
  
    Status = CFE_TIME_TaskInit();
    
    if(Status != CFE_SUCCESS)
    {
      CFE_ES_WriteToSysLog("TIME:Application Init Failed,RC=0x%08X\n", Status);      
      CFE_ES_PerfLogExit(CFE_TIME_MAIN_PERF_ID);
      /* Note: CFE_ES_ExitApp will not return */      
      CFE_ES_ExitApp(CFE_ES_CORE_APP_INIT_ERROR);
    }/* end if */
  
    /*
     * Wait for other apps to start.
     * It is important that the core apps are present before this starts receiving
     * messages from the command pipe, as some of those handlers might depend on
     * the other core apps.
     */
    CFE_ES_WaitForStartupSync(CFE_CORE_MAX_STARTUP_MSEC);

    /* Main loop */
    while (Status == CFE_SUCCESS)
    {
    
      /* Increment the Main task Execution Counter */
      CFE_ES_IncrementTaskCounter();

      CFE_ES_PerfLogExit(CFE_TIME_MAIN_PERF_ID);
  
      /* Pend on receipt of packet */
      Status = CFE_SB_RcvMsg(&CFE_TIME_TaskData.MsgPtr,
                              CFE_TIME_TaskData.CmdPipe,
                              CFE_SB_PEND_FOREVER);
  
      CFE_ES_PerfLogEntry(CFE_TIME_MAIN_PERF_ID);
  
      if (Status == CFE_SUCCESS)
      {
          /* Process cmd pipe msg */
          CFE_TIME_TaskPipe(CFE_TIME_TaskData.MsgPtr);
      }else{
          CFE_ES_WriteToSysLog("TIME:Error reading cmd pipe,RC=0x%08X\n",Status);
      }/* end if */
      
    }/* end while */
    
    /* while loop exits only if CFE_SB_RcvMsg returns error */
    CFE_ES_ExitApp(CFE_ES_CORE_APP_RUNTIME_ERROR);

} /* end CFE_TIME_TaskMain */
Exemplo n.º 2
0
void CFE_TBL_TaskMain(void)
{
    int32  Status;

    CFE_ES_PerfLogEntry(CFE_TBL_MAIN_PERF_ID);

    Status = CFE_TBL_TaskInit();
    
    if(Status != CFE_SUCCESS)
    {
      CFE_ES_WriteToSysLog("TBL:Application Init Failed,RC=0x%08X\n", Status);      
      CFE_ES_PerfLogExit(CFE_TBL_MAIN_PERF_ID);      
      /* Note: CFE_ES_ExitApp will not return */
      CFE_ES_ExitApp(CFE_ES_CORE_APP_INIT_ERROR);
    }/* end if */

    /* Main loop */
    while (Status == CFE_SUCCESS)
    {
        /* Increment the Main task Execution Counter */
        CFE_ES_IncrementTaskCounter();

        CFE_ES_PerfLogExit(CFE_TBL_MAIN_PERF_ID);

        /* Pend on receipt of packet */
        Status = CFE_SB_RcvMsg( &CFE_TBL_TaskData.MsgPtr,
                                CFE_TBL_TaskData.CmdPipe,
                                CFE_SB_PEND_FOREVER);

        CFE_ES_PerfLogEntry(CFE_TBL_MAIN_PERF_ID);

        if (Status == CFE_SUCCESS)
        {
            /* Process cmd pipe msg */
            CFE_TBL_TaskPipe(CFE_TBL_TaskData.MsgPtr);
        }else{
            CFE_ES_WriteToSysLog("TBL:Error reading cmd pipe,RC=0x%08X\n",Status);
        }/* end if */

    }/* end while */

    /* while loop exits only if CFE_SB_RcvMsg returns error */
    CFE_ES_ExitApp(CFE_ES_CORE_APP_RUNTIME_ERROR);

} /* end CFE_TBL_TaskMain() */
Exemplo n.º 3
0
void HS_IdleTask(void)
{
    OS_time_t PSPTime = {0,0};

    HS_CustomData.IdleTaskRunStatus = CFE_ES_RegisterChildTask();

    while (HS_CustomData.IdleTaskRunStatus == CFE_SUCCESS)
    {

        /* Check to see if we are to mark the time. */
        if(((HS_CustomData.ThisIdleTaskExec & HS_CustomData.UtilMask) == HS_CustomData.UtilMask) &&
           (HS_CustomData.ThisIdleTaskExec > HS_CustomData.UtilMask))
        {
            /* Entry and Exit markers are for easy time marking only; not performance */
            CFE_ES_PerfLogEntry(HS_IDLETASK_PERF_ID);

            /* Increment the child task Execution Counter */
            CFE_ES_IncrementTaskCounter();

            /* update stamp and array */
            CFE_PSP_GetTime(&PSPTime);
            HS_CustomData.UtilArray[HS_CustomData.UtilArrayIndex & HS_CustomData.UtilArrayMask] = (uint32) PSPTime.microsecs;
            HS_CustomData.UtilArrayIndex++;

            CFE_ES_PerfLogExit(HS_IDLETASK_PERF_ID);
        }

        /* Call the Utilization Tracking function */
        HS_UtilizationIncrement();

    }

    /*
    ** If the run status is externally set to something else
    */
    return;

} /* End of HS_IdleTask() */