added additional calls
This commit is contained in:
parent
6b475792a4
commit
4dcfa5125e
@ -43,6 +43,16 @@ ReturnValue_t SharedRingBuffer::deleteDataProtected(size_t amount,
|
|||||||
return SimpleRingBuffer::deleteData(amount, deleteRemaining, trueAmount);
|
return SimpleRingBuffer::deleteData(amount, deleteRemaining, trueAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t SharedRingBuffer::getExcessBytes() const {
|
||||||
|
MutexHelper(mutex, mutexTimeout);
|
||||||
|
return SimpleRingBuffer::getExcessBytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SharedRingBuffer::moveExcessBytesToStart() {
|
||||||
|
MutexHelper(mutex, mutexTimeout);
|
||||||
|
return SimpleRingBuffer::moveExcessBytesToStart();
|
||||||
|
}
|
||||||
|
|
||||||
size_t SharedRingBuffer::getAvailableReadDataProtected(uint8_t n) const {
|
size_t SharedRingBuffer::getAvailableReadDataProtected(uint8_t n) const {
|
||||||
MutexHelper(mutex, mutexTimeout);
|
MutexHelper(mutex, mutexTimeout);
|
||||||
return ((write + size) - read[n]) % size;
|
return ((write + size) - read[n]) % size;
|
||||||
|
@ -34,6 +34,14 @@ public:
|
|||||||
|
|
||||||
void setMutexTimeout(dur_millis_t newTimeout);
|
void setMutexTimeout(dur_millis_t newTimeout);
|
||||||
|
|
||||||
|
virtual size_t getExcessBytes() const override;
|
||||||
|
/**
|
||||||
|
* Helper functions which moves any excess bytes to the start
|
||||||
|
* of the ring buffer.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
virtual void moveExcessBytesToStart() override;
|
||||||
|
|
||||||
/** Performs mutex protected SimpleRingBuffer::getFreeElement call */
|
/** Performs mutex protected SimpleRingBuffer::getFreeElement call */
|
||||||
ReturnValue_t getFreeElementProtected(uint8_t** writePtr, size_t amount);
|
ReturnValue_t getFreeElementProtected(uint8_t** writePtr, size_t amount);
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t **writePointer,
|
|||||||
if((amount - amountTillWrap + excessBytes) > maxExcessBytes) {
|
if((amount - amountTillWrap + excessBytes) > maxExcessBytes) {
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
excessBytes += amount - amountTillWrap;
|
excessBytes = amount - amountTillWrap;
|
||||||
}
|
}
|
||||||
*writePointer = &buffer[write];
|
*writePointer = &buffer[write];
|
||||||
incrementWrite(amount);
|
incrementWrite(amount);
|
||||||
|
@ -64,13 +64,13 @@ public:
|
|||||||
*/
|
*/
|
||||||
ReturnValue_t getFreeElement(uint8_t** writePointer, size_t amount);
|
ReturnValue_t getFreeElement(uint8_t** writePointer, size_t amount);
|
||||||
|
|
||||||
size_t getExcessBytes() const;
|
virtual size_t getExcessBytes() const;
|
||||||
/**
|
/**
|
||||||
* Helper functions which moves any excess bytes to the start
|
* Helper functions which moves any excess bytes to the start
|
||||||
* of the ring buffer.
|
* of the ring buffer.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
void moveExcessBytesToStart();
|
virtual void moveExcessBytesToStart();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read from circular buffer at read pointer.
|
* Read from circular buffer at read pointer.
|
||||||
|
Loading…
Reference in New Issue
Block a user