From a891769a02949d82a144bc5ea8f0e6522b0ce14e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 24 Mar 2022 11:32:27 +0100 Subject: [PATCH] ring buffer cfg error warning --- src/fsfw/container/SimpleRingBuffer.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/fsfw/container/SimpleRingBuffer.cpp b/src/fsfw/container/SimpleRingBuffer.cpp index 0c95fe40..7e9aac1a 100644 --- a/src/fsfw/container/SimpleRingBuffer.cpp +++ b/src/fsfw/container/SimpleRingBuffer.cpp @@ -1,4 +1,7 @@ #include "fsfw/container/SimpleRingBuffer.h" +#include "fsfw/FSFW.h" + +#include "fsfw/serviceinterface.h" #include @@ -48,7 +51,14 @@ void SimpleRingBuffer::confirmBytesWritten(size_t amount) { } ReturnValue_t SimpleRingBuffer::writeData(const uint8_t* data, size_t amount) { - if(amount > maxSize()) { + if(amount > getMaxSize()) { +#if FSFW_VERBOSE_LEVEL >= 1 +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::error << "SimpleRingBuffer::writeData: Amount of data too large" << std::endl; +#else + sif::printError("SimpleRingBuffer::writeData: Amount of data too large\n"); +#endif +#endif return HasReturnvaluesIF::RETURN_FAILED; } if (availableWriteSpace() >= amount or overwriteOld) {