possibly important fix for ring buffer write
This commit is contained in:
parent
e08bdd3e35
commit
df97c582d7
@ -48,6 +48,9 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) {
|
||||||
|
if(amount > maxSize()) {
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
if (availableWriteSpace() >= amount or overwriteOld) {
|
if (availableWriteSpace() >= amount or overwriteOld) {
|
||||||
size_t amountTillWrap = writeTillWrap();
|
size_t amountTillWrap = writeTillWrap();
|
||||||
if (amountTillWrap >= amount) {
|
if (amountTillWrap >= amount) {
|
||||||
|
Loading…
Reference in New Issue
Block a user