Skip to content

Commit 8554fc4

Browse files
authored
Add is_at_the_end_of_time() method (earlephilhower#784)
1 parent 01290c4 commit 8554fc4

File tree

1 file changed

+10
-0
lines changed
  • src/common/pico_time/include/pico

1 file changed

+10
-0
lines changed

src/common/pico_time/include/pico/time.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,16 @@ static inline int64_t absolute_time_diff_us(absolute_time_t from, absolute_time_
162162
*/
163163
extern const absolute_time_t at_the_end_of_time;
164164

165+
/*! \brief Determine if the given timestamp is "at_the_end_of_time"
166+
* \ingroup timestamp
167+
* \param t the timestamp
168+
* \return true if the timestamp is at_the_end_of_time
169+
* \sa at_the_end_of_time
170+
*/
171+
static inline bool is_at_the_end_of_time(absolute_time_t t) {
172+
return to_us_since_boot(t) == to_us_since_boot(at_the_end_of_time);
173+
}
174+
165175
/*! \brief The timestamp representing a null timestamp
166176
* \ingroup timestamp
167177
*/

0 commit comments

Comments
 (0)