/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
CFE_TIME_SysTime_t CFE_TIME_LatchClock(void)
{
    CFE_TIME_SysTime_t LatchTime;
    OS_time_t LocalTime;

    /*
    ** Get time in O/S format (seconds : microseconds)...
    */
    CFE_PSP_GetTime(&LocalTime);

    /*
    ** Convert time to cFE format (seconds : 1/2^32 subseconds)...
    */
    LatchTime.Seconds = LocalTime.seconds;
    LatchTime.Subseconds = CFE_TIME_Micro2SubSecs(LocalTime.microsecs);

    return(LatchTime);

} /* End of CFE_TIME_LatchClock() */
Esempio n. 2
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() */