From 8554fc4ea1411c8b5d48d291459d2a8e3097e0f8 Mon Sep 17 00:00:00 2001 From: bruelltuete Date: Tue, 3 May 2022 17:55:01 +0100 Subject: [PATCH] Add is_at_the_end_of_time() method (#784) --- src/common/pico_time/include/pico/time.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/pico_time/include/pico/time.h b/src/common/pico_time/include/pico/time.h index 9a6ce43..0fde00f 100644 --- a/src/common/pico_time/include/pico/time.h +++ b/src/common/pico_time/include/pico/time.h @@ -162,6 +162,16 @@ static inline int64_t absolute_time_diff_us(absolute_time_t from, absolute_time_ */ extern const absolute_time_t at_the_end_of_time; +/*! \brief Determine if the given timestamp is "at_the_end_of_time" + * \ingroup timestamp + * \param t the timestamp + * \return true if the timestamp is at_the_end_of_time + * \sa at_the_end_of_time + */ +static inline bool is_at_the_end_of_time(absolute_time_t t) { + return to_us_since_boot(t) == to_us_since_boot(at_the_end_of_time); +} + /*! \brief The timestamp representing a null timestamp * \ingroup timestamp */