diff --git a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp index dd928efe..092c234c 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp +++ b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp @@ -58,6 +58,9 @@ ServiceInterfaceBuffer::ServiceInterfaceBuffer(std::string setMessage, bool addC } void ServiceInterfaceBuffer::putChars(char const* begin, char const* end) { + if (not isActive) { + return; + } char array[BUF_SIZE]; uint32_t length = end - begin; if (length > sizeof(array)) { diff --git a/src/fsfw_hal/common/CMakeLists.txt b/src/fsfw_hal/common/CMakeLists.txt index f1cfec52..1cd9c678 100644 --- a/src/fsfw_hal/common/CMakeLists.txt +++ b/src/fsfw_hal/common/CMakeLists.txt @@ -1 +1,3 @@ add_subdirectory(gpio) + +target_sources(${LIB_FSFW_NAME} PRIVATE printChar.c) \ No newline at end of file diff --git a/src/fsfw_hal/common/printChar.c b/src/fsfw_hal/common/printChar.c new file mode 100644 index 00000000..6e02c1df --- /dev/null +++ b/src/fsfw_hal/common/printChar.c @@ -0,0 +1,10 @@ +#include +#include + +void __attribute__((weak)) printChar(const char* character, bool errStream) { + if (errStream) { + fprintf(stderr, "%c", *character); + } else { + printf("%c", *character); + } +}