diff --git a/lib/include/srslte/common/timers.h b/lib/include/srslte/common/timers.h index a597a4133..a969c67bd 100644 --- a/lib/include/srslte/common/timers.h +++ b/lib/include/srslte/common/timers.h @@ -69,7 +69,7 @@ class timer_handler bool is_expired() const { return active and not running and timeout > 0 and timeout <= parent->cur_time; } - uint32_t value() const { return parent->cur_time - (timeout - duration); } + uint32_t value() const { return std::min(duration, parent->cur_time - (timeout - duration)); } bool set(uint32_t duration_) {