triggerbox: implement TriggerBox::peek_next_trigger()

This commit is contained in:
Paul Davis 2022-08-28 18:57:39 -06:00
parent 45144d841e
commit aef1adc6f0

View File

@ -3313,6 +3313,23 @@ TriggerBox::queue_explict (uint32_t n)
}
}
TriggerPtr
TriggerBox::peek_next_trigger ()
{
RingBuffer<uint32_t>::rw_vector rwv;
explicit_queue.get_read_vector (&rwv);
if (rwv.len[0] > 0) {
/* peek at it without dequeing it */
uint32_t n = *(rwv.buf[0]);
return trigger (n);
}
return TriggerPtr();
}
TriggerPtr
TriggerBox::get_next_trigger ()
{