1
0
forked from fsfw/fsfw

no run-time dyn memory allocation now

This commit is contained in:
2020-06-04 19:37:33 +02:00
parent c0808e71d9
commit 3a573c1b4c
4 changed files with 31 additions and 50 deletions

View File

@ -68,12 +68,15 @@ int ServiceInterfaceBuffer::overflow(int c) {
}
int ServiceInterfaceBuffer::sync(void) {
if(not this->isActive) {
if(not this->isActive and not buffered) {
if(not buffered) {
setp(buf, buf + BUF_SIZE - 1);
}
return 0;
}
if(not buffered) {
return 0;
}
size_t preambleSize = 0;
auto preamble = getPreamble(&preambleSize);
@ -88,6 +91,9 @@ int ServiceInterfaceBuffer::sync(void) {
return 0;
}
bool ServiceInterfaceBuffer::isBuffered() const {
return buffered;
}
std::string ServiceInterfaceBuffer::getPreamble(size_t * preambleSize) {
Clock::TimeOfDay_t loggerTime;