diff --git a/.gitignore b/.gitignore
index d6efb9cf..eb461072 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,14 @@
+# PyCharm and CLion
+/.idea/*
+!/.idea/runConfigurations
+!/.idea/cmake.xml
+!/.idea/codeStyles
+
+# Eclipse
.cproject
.project
.settings
.metadata
/build*
+/cmake-build*
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 00000000..0f3b1a4b
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 00000000..79ee123c
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/fsfw-tests_coverage.run.xml b/.run/fsfw-tests_coverage.run.xml
new file mode 100644
index 00000000..49d9b135
--- /dev/null
+++ b/.run/fsfw-tests_coverage.run.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/fsfw.run.xml b/.run/fsfw.run.xml
new file mode 100644
index 00000000..72f74939
--- /dev/null
+++ b/.run/fsfw.run.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4713ed17..65fc85a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Changes
+- Renamed auto-formatting script to `auto-formatter.sh` and made it more robust.
+ If `cmake-format` is installed, it will also auto-format the `CMakeLists.txt` files now.
+ PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/625
+ PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/626
- Bump C++ required version to C++17. Every project which uses the FSFW and every modern
compiler supports it
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/622
@@ -84,6 +88,8 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
## Additions
+- Basic `clion` support: Update `.gitignore` and add some basic run configurations
+ PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/625
- LTO support: Allow using LTO/IPO by setting `FSFW_ENABLE_LTO=1`. CMake is able to detect whether
the user compiler supports IPO/LPO. LTO is on by default now. Most modern compilers support it,
can make good use of it and it usually makes the code faster and/or smaller.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40c0b879..6328f176 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,7 @@ set(FSFW_ETL_LIB_MAJOR_VERSION
20
CACHE STRING "ETL library major version requirement")
set(FSFW_ETL_LIB_VERSION
- ${FSFW_ETL_LIB_MAJOR_VERSION}.27.3
+ ${FSFW_ETL_LIB_MAJOR_VERSION}.28.0
CACHE STRING "ETL library exact version requirement")
set(FSFW_ETL_LINK_TARGET etl::etl)
@@ -185,7 +185,7 @@ endif()
message(STATUS "${MSG_PREFIX} Finding and/or providing ETL library")
# Check whether the user has already installed ETL first
-find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} QUIET)
+find_package(${FSFW_ETL_LIB_NAME} ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
# Not installed, so use FetchContent to download and provide etl
if(NOT ${FSFW_ETL_LIB_NAME}_FOUND)
message(
diff --git a/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp b/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp
index dcf92b5d..b06def69 100644
--- a/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp
+++ b/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp
@@ -210,7 +210,7 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie* spiCookie, const
#endif
return result;
}
- ReturnValue_t result = gpioComIF->pullLow(gpioId);
+ result = gpioComIF->pullLow(gpioId);
if (result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
diff --git a/src/fsfw/datapoollocal/LocalDataPoolManager.cpp b/src/fsfw/datapoollocal/LocalDataPoolManager.cpp
index 781d8f71..215d1753 100644
--- a/src/fsfw/datapoollocal/LocalDataPoolManager.cpp
+++ b/src/fsfw/datapoollocal/LocalDataPoolManager.cpp
@@ -696,9 +696,9 @@ void LocalDataPoolManager::performPeriodicHkGeneration(HkReceiver& receiver) {
if (result != HasReturnvaluesIF::RETURN_OK) {
/* Configuration error */
#if FSFW_CPP_OSTREAM_ENABLED == 1
- sif::warning << "LocalDataPoolManager::performHkOperation: HK generation failed." << std::endl;
+ sif::warning << "LocalDataPoolManager::performPeriodicHkOperation: HK generation failed." << std::endl;
#else
- sif::printWarning("LocalDataPoolManager::performHkOperation: HK generation failed.\n");
+ sif::printWarning("LocalDataPoolManager::performPeriodicHkOperation: HK generation failed.\n");
#endif
}
}
diff --git a/src/fsfw/osal/rtems/MessageQueue.cpp b/src/fsfw/osal/rtems/MessageQueue.cpp
index f52f1852..534015dc 100644
--- a/src/fsfw/osal/rtems/MessageQueue.cpp
+++ b/src/fsfw/osal/rtems/MessageQueue.cpp
@@ -65,7 +65,7 @@ ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo, MessageQueu
}
ReturnValue_t returnCode = convertReturnCode(result);
- if (result == MessageQueueIF::EMPTY) {
+ if (returnCode == MessageQueueIF::EMPTY) {
return HasReturnvaluesIF::RETURN_FAILED;
}
diff --git a/src/fsfw/osal/rtems/MessageQueue.h b/src/fsfw/osal/rtems/MessageQueue.h
index bb31a508..2649b880 100644
--- a/src/fsfw/osal/rtems/MessageQueue.h
+++ b/src/fsfw/osal/rtems/MessageQueue.h
@@ -36,9 +36,9 @@ class MessageQueue : public MessageQueueBase {
* @param max_message_size With this parameter, the maximum message size can be adjusted.
* This should be left default.
*/
- MessageQueue(size_t message_depth = 3,
- size_t max_message_size = MessageQueueMessage::MAX_MESSAGE_SIZE,
- MqArgs* args = nullptr);
+ explicit MessageQueue(size_t message_depth = 3,
+ size_t max_message_size = MessageQueueMessage::MAX_MESSAGE_SIZE,
+ MqArgs* args = nullptr);
/** Copying message queues forbidden */
MessageQueue(const MessageQueue&) = delete;
@@ -48,13 +48,14 @@ class MessageQueue : public MessageQueueBase {
* @brief The destructor deletes the formerly created message queue.
* @details This is accomplished by using the delete call provided by the operating system.
*/
- virtual ~MessageQueue();
+ ~MessageQueue() override;
// Implement non-generic MessageQueueIF functions not handled by MessageQueueBase
ReturnValue_t flush(uint32_t* count) override;
+
+ ReturnValue_t receiveMessage(MessageQueueMessageIF* message) override;
ReturnValue_t sendMessageFrom(MessageQueueId_t sendTo, MessageQueueMessageIF* message,
- MessageQueueId_t sentFrom = NO_QUEUE,
- bool ignoreFault = false) override;
+ MessageQueueId_t sentFrom, bool ignoreFault) override;
private:
/**
diff --git a/src/fsfw/osal/rtems/QueueFactory.cpp b/src/fsfw/osal/rtems/QueueFactory.cpp
index 2519f444..074ce273 100644
--- a/src/fsfw/osal/rtems/QueueFactory.cpp
+++ b/src/fsfw/osal/rtems/QueueFactory.cpp
@@ -45,9 +45,9 @@ QueueFactory* QueueFactory::instance() {
return factoryInstance;
}
-QueueFactory::QueueFactory() {}
+QueueFactory::QueueFactory() = default;
-QueueFactory::~QueueFactory() {}
+QueueFactory::~QueueFactory() = default;
MessageQueueIF* QueueFactory::createMessageQueue(uint32_t messageDepth, size_t maxMessageSize,
MqArgs* args) {
diff --git a/src/fsfw/pus/Service11TelecommandScheduling.tpp b/src/fsfw/pus/Service11TelecommandScheduling.tpp
index cb43e8e8..968a59ff 100644
--- a/src/fsfw/pus/Service11TelecommandScheduling.tpp
+++ b/src/fsfw/pus/Service11TelecommandScheduling.tpp
@@ -615,23 +615,23 @@ inline ReturnValue_t Service11TelecommandScheduling::handleInvalidD
template
inline void Service11TelecommandScheduling::debugPrintMultimapContent() const {
- for ([[maybe_unused]] const auto &dit : telecommandMap) {
#if FSFW_DISABLE_PRINTOUT == 0
#if FSFW_CPP_OSTREAM_ENABLED == 1
- sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
- << std::endl;
+ sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
+ << std::endl;
+#else
+ sif::printDebug("Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content\n");
+#endif
+ for (const auto &dit : telecommandMap) {
+#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "[" << dit.first << "]: Request ID: " << dit.second.requestId << " | "
<< "Store Address: " << dit.second.storeAddr.raw << std::endl;
#else
- sif::printDebug(
- "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content\n");
- for (auto dit = telecommandMap.begin(); dit != telecommandMap.end(); ++dit) {
- sif::printDebug("[%d]: Request ID: %d | Store Address: %d\n", dit->first,
- dit->second.requestId, dit->second.storeAddr);
- }
-#endif
+ sif::printDebug("[%d]: Request ID: %d | Store Address: %d\n", dit.first, dit.second.requestId,
+ dit.second.storeAddr);
#endif
}
+#endif
}
template