CORDET Framework - C2 Implementation
CrFwTime.c File Reference

Default implementation of the time interface of CrFwTime.h. More...

Go to the source code of this file.

Functions

CrFwTimeStamp_t CrFwGetCurrentTimeStamp ()
 Return the current time in the format used for the command and report time-stamp. More...
 
CrFwTime_t CrFwGetCurrentTime ()
 Return the current application time in standard format. More...
 
CrFwTimeCyc_t CrFwGetCurrentCycTime ()
 Return the current time in "cycle format" (integer number of cycles elapsed since some event). More...
 
CrFwTimeStamp_t CrFwStdTimeToTimeStamp (CrFwTime_t stdTime)
 Convert a time value from standard time format to time-stamp format. More...
 
CrFwTime_t CrFwTimeStampToStdTime (CrFwTimeStamp_t timeStamp)
 Convert a time value from time-stamp format to standard time format. More...
 

Variables

static CrFwTimeStamp_t dummyTime = 0
 The CrFwGetCurrentTimeStamp function increments this counter and then returns its value.
 

Detailed Description

Default implementation of the time interface of CrFwTime.h.

The implementation of this interface is one of the adaptation points of the CORDET Framework. This file provides a default implementation which is primarily intended to support testing. It is expected that applications will provide their own implementation. Application will therefore normally replace this file with their own file providing their application-specific implementation.

This implementation maintains an integer which is incremented by 1 every time function CrFwGetCurrentTimeStamp is called. This function represents the "current time" and its value is returned by the various time getter functions defined by this interface.

Author
Vaclav Cechticky vacla.nosp@m.v.ce.nosp@m.chtic.nosp@m.ky@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m
Alessandro Pasetti paset.nosp@m.ti@p.nosp@m.np-so.nosp@m.ftwa.nosp@m.re.co.nosp@m.m

This file is part of the CORDET Framework.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

For information on alternative licensing, please contact P&P Software GmbH.

Definition in file CrFwTime.c.

Function Documentation

CrFwTimeCyc_t CrFwGetCurrentCycTime ( )

Return the current time in "cycle format" (integer number of cycles elapsed since some event).

If the host application does not support the "cycle format", this function returns zero.

Returns
the current time in cycle format or zero if the cycle format is not supported.

Definition at line 51 of file CrFwTime.c.

CrFwTime_t CrFwGetCurrentTime ( )

Return the current application time in standard format.

If the host application does not support this time format, then this function is implemented to return zero.

Returns
the current time in standard format or zero if this format is not supported.

Definition at line 46 of file CrFwTime.c.

CrFwTimeStamp_t CrFwGetCurrentTimeStamp ( )

Return the current time in the format used for the command and report time-stamp.

Returns
the current time.

Definition at line 40 of file CrFwTime.c.

CrFwTimeStamp_t CrFwStdTimeToTimeStamp ( CrFwTime_t  stdTime)

Convert a time value from standard time format to time-stamp format.

Parameters
stdTimethe time in standard format
Returns
the time in time-stamp format

Definition at line 56 of file CrFwTime.c.

CrFwTime_t CrFwTimeStampToStdTime ( CrFwTimeStamp_t  timeStamp)

Convert a time value from time-stamp format to standard time format.

Parameters
timeStampthe time in time-stamp format
Returns
the time in standard format

Definition at line 61 of file CrFwTime.c.

P&P Software GmbH, Copyright 2012-2013, All Rights Reserved