renormalize files

This commit is contained in:
Robin Müller 2020-09-04 15:04:53 +02:00
parent 543e2f7d5d
commit d885dddee8
2 changed files with 263 additions and 263 deletions

View File

@ -33,7 +33,7 @@ SimpleRingBuffer::~SimpleRingBuffer() {
ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t **writePointer, ReturnValue_t SimpleRingBuffer::getFreeElement(uint8_t **writePointer,
size_t amount) { size_t amount) {
if ((availableWriteSpace() >= amount) or overwriteOld) { if (availableWriteSpace() >= amount or overwriteOld) {
size_t amountTillWrap = writeTillWrap(); size_t amountTillWrap = writeTillWrap();
if (amountTillWrap < amount) { if (amountTillWrap < amount) {
if((amount - amountTillWrap + excessBytes) > maxExcessBytes) { if((amount - amountTillWrap + excessBytes) > maxExcessBytes) {
@ -59,7 +59,7 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) {
ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data,
size_t amount) { size_t amount) {
if ((availableWriteSpace() >= amount) or overwriteOld) { if (availableWriteSpace() >= amount or overwriteOld) {
size_t amountTillWrap = writeTillWrap(); size_t amountTillWrap = writeTillWrap();
if (amountTillWrap >= amount) { if (amountTillWrap >= amount) {
// remaining size in buffer is sufficient to fit full amount. // remaining size in buffer is sufficient to fit full amount.