diff --git a/core/net/rime/timesynch.c b/core/net/rime/timesynch.c index 43fdd3b74..6ddf11f4c 100644 --- a/core/net/rime/timesynch.c +++ b/core/net/rime/timesynch.c @@ -34,7 +34,7 @@ * * This file is part of the Contiki operating system. * - * $Id: timesynch.c,v 1.2 2008/01/14 14:50:01 adamdunkels Exp $ + * $Id: timesynch.c,v 1.3 2008/01/23 15:07:05 adamdunkels Exp $ */ /** @@ -80,6 +80,12 @@ timesynch_time_to_rtimer(rtimer_clock_t synched_time) } /*---------------------------------------------------------------------------*/ rtimer_clock_t +timesynch_rtimer_to_time(rtimer_clock_t rtimer_time) +{ + return rtimer_time + offset; +} +/*---------------------------------------------------------------------------*/ +rtimer_clock_t timesynch_offset(void) { return offset; diff --git a/core/net/rime/timesynch.h b/core/net/rime/timesynch.h index 57cafc9d5..f729e1ac3 100644 --- a/core/net/rime/timesynch.h +++ b/core/net/rime/timesynch.h @@ -55,7 +55,7 @@ * * This file is part of the Contiki operating system. * - * $Id: timesynch.h,v 1.2 2008/01/14 14:50:02 adamdunkels Exp $ + * $Id: timesynch.h,v 1.3 2008/01/23 15:07:05 adamdunkels Exp $ */ /** @@ -91,7 +91,7 @@ void timesynch_init(void); rtimer_clock_t timesynch_time(void); /** - * \brief Get the current time-synchronized rtimer time, suitable for use with the rtimer module + * \brief Get the current time-synchronized time, suitable for use with the rtimer module * \return The current time-synchronized rtimer time * * This function returns the (local) rtimer-equivalent @@ -103,6 +103,16 @@ rtimer_clock_t timesynch_time(void); */ rtimer_clock_t timesynch_time_to_rtimer(rtimer_clock_t synched_time); +/** + * \brief Get the synchronized equivalent of an rtimer time + * \return The synchronized equivalent of an rtimer time + * + * This function returns the time synchronized equivalent + * time corresponding to a (local) rtimer time. + * + */ +rtimer_clock_t timesynch_rtimer_to_time(rtimer_clock_t rtimer_time); + /** * \brief Get the current time-synchronized offset from the rtimer clock, which is used mainly for debugging * \return The current time-synchronized offset from the rtimer clock