mirror of https://github.com/ArduPilot/ardupilot
AP_HAL/utility: clear added to RingBuffer
This commit is contained in:
parent
a07033f938
commit
d1792689f1
|
@ -104,6 +104,12 @@ public:
|
|||
delete buffer;
|
||||
}
|
||||
|
||||
// Discards the buffer content, emptying it.
|
||||
void clear(void)
|
||||
{
|
||||
buffer->clear();
|
||||
}
|
||||
|
||||
// return number of objects available to be read
|
||||
uint32_t available(void) const {
|
||||
return buffer->available() / sizeof(T);
|
||||
|
@ -229,6 +235,12 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
// Discards the buffer content, emptying it.
|
||||
void clear(void)
|
||||
{
|
||||
head = count = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
pop earliest object off the queue
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue