src/ssx/ssx/ssx_timer_core.c
/// Get information about a timer.
///
/// \param timer The SsxTimer to query
///
/// \param timeout The API returns the absolute timeout of the timer through
/// this pointer.  If the timer is active, this is the current timeout.  If
/// the timer has timed out then this is the previous absolute timeout.  If
/// the timer was never scheduled this will be 0.  The caller can set this
/// parameter to the null pointer (0) if this information is not required.
///
/// \param active If the value returned through this pointer is 1 then the
/// timer is active (currently scheduled), otherwise the value will be 0
/// indicating an inactive timer. The caller can set this parameter to the
/// null pointer (0) if this information is not required.
///
/// The information returned by this API can only be guaranteed consistent if
/// the API is called from an SSX_NONCRITICAL critical section. Since the
/// implementation of this API does not require a critical section, it is not
/// an error to call this API from a critical interrupt context.
///
/// Return values other than SSX_OK (0) are errors; see \ref ssx_errors
///
/// \retval 0 Successful completion
///
/// \retval -SSX_INVALID_TIMER_AT_INFO The \a timer is a null (0) pointer.
Get information about a timer.
\param timer The SsxTimer to query

\param timeout The API returns the absolute timeout of the timer through
this pointer.  If the timer is active, this is the current timeout.  If
the timer has timed out then this is the previous absolute timeout.  If
the timer was never scheduled this will be 0.  The caller can set this
parameter to the null pointer (0) if this information is not required.

\param active If the value returned through this pointer is 1 then the
timer is active (currently scheduled), otherwise the value will be 0
indicating an inactive timer. The caller can set this parameter to the
null pointer (0) if this information is not required.

The information returned by this API can only be guaranteed consistent if
the API is called from an SSX_NONCRITICAL critical section. Since the
implementation of this API does not require a critical section, it is not
an error to call this API from a critical interrupt context.

Return values other than SSX_OK (0) are errors; see \ref ssx_errors

\retval 0 Successful completion

\retval -SSX_INVALID_TIMER_AT_INFO The \a timer is a null (0) pointer.
Get information about a timer . \ param timer The SsxTimer to query \ param timeout The API returns the absolute timeout of the timer through this pointer . If the timer is active this is the current timeout . If the timer has timed out then this is the previous absolute timeout . If the timer was never scheduled this will be 0 . The caller can set this parameter to the null pointer ( 0 ) if this information is not required . \ param active If the value returned through this pointer is 1 then the timer is active ( currently scheduled ) otherwise the value will be 0 indicating an inactive timer . The caller can set this parameter to the null pointer ( 0 ) if this information is not required . The information returned by this API can only be guaranteed consistent if the API is called from an SSX_NONCRITICAL critical section . Since the implementation of this API does not require a critical section it is not an error to call this API from a critical interrupt context . Return values other than SSX_OK ( 0 ) are errors ; see \ ref ssx_errors \ retval 0 Successful completion \ retval - SSX_INVALID_TIMER_AT_INFO The \ a timer is a null ( 0 ) pointer .
int
ssx_timer_info_get(SsxTimer*    timer,
                   SsxTimebase* timeout,
                   int*         active)
{
    if (SSX_ERROR_CHECK_API)
    {
        SSX_ERROR_IF(timer == 0, SSX_INVALID_TIMER_AT_INFO);
    }
    if (timeout)
    {
        *timeout = timer->timeout;
    }
    if (active)
    {
        *active = timer_active(timer);
    }
    return SSX_OK;
}
int ssx_timer_info_get ( SsxTimer * timer , SsxTimebase * timeout , int * active ) { if ( SSX_ERROR_CHECK_API ) { SSX_ERROR_IF ( timer == 0 , SSX_INVALID_TIMER_AT_INFO ) ; } if ( timeout ) { * timeout = timer -> timeout ; } if ( active ) { * active = timer_active ( timer ) ; } return SSX_OK ; }
Get information about a timer.
Get information about a timer .