fsfw-example-common/example/utility/utility.cpp

23 lines
878 B
C++
Raw Normal View History

2021-06-08 13:46:45 +02:00
#include "utility.h"
2022-05-05 20:55:28 +02:00
2021-06-08 13:46:45 +02:00
#include <FSFWConfig.h>
#include <OBSWVersion.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
2022-05-22 15:30:08 +02:00
void utility::commonInitPrint(const char *const os, const char *const board) {
2022-05-05 20:55:28 +02:00
if (os == nullptr or board == nullptr) {
return;
}
2021-06-08 13:46:45 +02:00
#if FSFW_CPP_OSTREAM_ENABLED == 1
2022-05-05 20:55:28 +02:00
std::cout << "-- FSFW Example (" << os << ") v" << FSFW_EXAMPLE_VERSION << "."
2022-08-08 12:32:06 +02:00
<< FSFW_EXAMPLE_SUBVERSION << "." << FSFW_EXAMPLE_REVISION << " --" << std::endl;
2022-05-05 20:55:28 +02:00
std::cout << "-- Compiled for " << board << " --" << std::endl;
2022-08-08 12:32:06 +02:00
std::cout << "-- Compiled on " << __DATE__ << " " << __TIME__ << " --" << std::endl;
2021-06-08 13:46:45 +02:00
#else
2022-05-05 20:55:28 +02:00
printf("\n\r-- FSFW Example (%s) v%d.%d.%d --\n", os, FSFW_EXAMPLE_VERSION,
FSFW_EXAMPLE_SUBVERSION, FSFW_EXAMPLE_REVISION);
printf("-- Compiled for %s --\n", board);
printf("-- Compiled on %s %s --\n", __DATE__, __TIME__);
2021-06-08 13:46:45 +02:00
#endif
}