ring buffer cfg error warning

This commit is contained in:
Robin Müller 2022-03-24 11:32:27 +01:00
parent df97c582d7
commit a891769a02
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -1,4 +1,7 @@
#include "fsfw/container/SimpleRingBuffer.h" #include "fsfw/container/SimpleRingBuffer.h"
#include "fsfw/FSFW.h"
#include "fsfw/serviceinterface.h"
#include <cstring> #include <cstring>
@ -48,7 +51,14 @@ 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()) { 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; return HasReturnvaluesIF::RETURN_FAILED;
} }
if (availableWriteSpace() >= amount or overwriteOld) { if (availableWriteSpace() >= amount or overwriteOld) {