From a5cf510ae9d90b79499e0355861adbb49eaf7191 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 30 Oct 2020 13:31:07 +0100 Subject: [PATCH] host osal fixes --- osal/host/QueueFactory.cpp | 7 ++++++- timemanager/CCSDSTime.cpp | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/osal/host/QueueFactory.cpp b/osal/host/QueueFactory.cpp index da3fea55..1a679c96 100644 --- a/osal/host/QueueFactory.cpp +++ b/osal/host/QueueFactory.cpp @@ -1,6 +1,11 @@ + +#include "MessageQueue.h" + +#include "../../ipc/MessageQueueSenderIF.h" +#include "../../ipc/MessageQueueMessageIF.h" #include "../../ipc/QueueFactory.h" -#include "../../osal/host/MessageQueue.h" #include "../../serviceinterface/ServiceInterfaceStream.h" + #include QueueFactory* QueueFactory::factoryInstance = nullptr; diff --git a/timemanager/CCSDSTime.cpp b/timemanager/CCSDSTime.cpp index f99f8fbb..f137e030 100644 --- a/timemanager/CCSDSTime.cpp +++ b/timemanager/CCSDSTime.cpp @@ -1,8 +1,9 @@ -#include "../timemanager/CCSDSTime.h" +#include "CCSDSTime.h" + #include #include #include - +#include CCSDSTime::CCSDSTime() { } @@ -158,15 +159,16 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* } // Newlib nano can't parse uint8, see SCNu8 documentation and https://sourceware.org/newlib/README // Suggestion: use uint16 all the time. This should work on all systems. -#ifdef NEWLIB_NANO_NO_C99_IO +#if FSFW_NO_C99_IO == 1 uint16_t year; uint16_t month; uint16_t day; uint16_t hour; uint16_t minute; float second; - int count = sscanf((char *) from, "%4" SCNu16 "-%2" SCNu16 "-%2" SCNu16 "T%2" SCNu16 ":%2" SCNu16 ":%fZ", &year, - &month, &day, &hour, &minute, &second); + int count = sscanf((char *) from, "%4" SCNu16 "-%2" SCNu16 "-%2" SCNu16 "T%" + "2" SCNu16 ":%2" SCNu16 ":%fZ", &year, &month, &day, &hour, + &minute, &second); if (count == 6) { to->year = year; to->month = month; @@ -179,12 +181,13 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t* } // try Code B (yyyy-ddd) - count = sscanf((char *) from, "%4" SCNu16 "-%3" SCNu16 "T%2" SCNu16 ":%2" SCNu16 ":%fZ", &year, &day, - &hour, &minute, &second); + count = sscanf((char *) from, "%4" SCNu16 "-%3" SCNu16 "T%2" SCNu16 ":%" + "2" SCNu16 ":%fZ", &year, &day, &hour, &minute, &second); if (count == 5) { uint8_t tempDay; ReturnValue_t result = CCSDSTime::convertDaysOfYear(day, year, - reinterpret_cast(&month), reinterpret_cast(&tempDay)); + reinterpret_cast(&month), + reinterpret_cast(&tempDay)); if (result != RETURN_OK) { return RETURN_FAILED; }