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 caf36af8..cf3a50c0 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
@@ -72,6 +76,8 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
- Added options for CI/CD builds: `FSFW_CICD_BUILD`. This allows the source code to know
whether it is running in CI/CD
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/623
+- 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/hal/src/fsfw_hal/linux/uart/UartComIF.cpp b/hal/src/fsfw_hal/linux/uart/UartComIF.cpp
index 72c79df6..f77bdeae 100644
--- a/hal/src/fsfw_hal/linux/uart/UartComIF.cpp
+++ b/hal/src/fsfw_hal/linux/uart/UartComIF.cpp
@@ -314,7 +314,7 @@ void UartComIF::configureBaudrate(struct termios* options, UartCookie* uartCooki
cfsetispeed(options, B4000000);
cfsetospeed(options, B4000000);
break;
-#endif // ! __APPLE__
+#endif // ! __APPLE__
default:
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "UartComIF::configureBaudrate: Baudrate not supported" << std::endl;
diff --git a/src/fsfw/container/FixedArrayList.h b/src/fsfw/container/FixedArrayList.h
index 11882537..fc8be393 100644
--- a/src/fsfw/container/FixedArrayList.h
+++ b/src/fsfw/container/FixedArrayList.h
@@ -12,6 +12,7 @@ template
class FixedArrayList : public ArrayList {
static_assert(MAX_SIZE <= std::numeric_limits::max(),
"count_t is not large enough to hold MAX_SIZE");
+
private:
T data[MAX_SIZE];
diff --git a/src/fsfw/devicehandlers/DeviceHandlerBase.h b/src/fsfw/devicehandlers/DeviceHandlerBase.h
index 5808b8e6..84dcb8dc 100644
--- a/src/fsfw/devicehandlers/DeviceHandlerBase.h
+++ b/src/fsfw/devicehandlers/DeviceHandlerBase.h
@@ -1062,7 +1062,8 @@ class DeviceHandlerBase : public DeviceHandlerIF,
/**
* Same as triggerEvent, but for forwarding if object is used as proxy.
*/
- virtual void forwardEvent(Event event, uint32_t parameter1 = 0, uint32_t parameter2 = 0) const override;
+ virtual void forwardEvent(Event event, uint32_t parameter1 = 0,
+ uint32_t parameter2 = 0) const override;
/**
* Checks if current mode is transitional mode.
diff --git a/src/fsfw/objectmanager/SystemObject.h b/src/fsfw/objectmanager/SystemObject.h
index eeb68b8f..c541ac5e 100644
--- a/src/fsfw/objectmanager/SystemObject.h
+++ b/src/fsfw/objectmanager/SystemObject.h
@@ -50,7 +50,8 @@ class SystemObject : public SystemObjectIF {
virtual ReturnValue_t initialize() override;
virtual ReturnValue_t checkObjectConnections() override;
- virtual void forwardEvent(Event event, uint32_t parameter1 = 0, uint32_t parameter2 = 0) const override;
+ virtual void forwardEvent(Event event, uint32_t parameter1 = 0,
+ uint32_t parameter2 = 0) const override;
};
#endif /* FSFW_OBJECTMANAGER_SYSTEMOBJECT_H_ */
diff --git a/src/fsfw/osal/common/TcpTmTcServer.cpp b/src/fsfw/osal/common/TcpTmTcServer.cpp
index 91cb9574..b9089245 100644
--- a/src/fsfw/osal/common/TcpTmTcServer.cpp
+++ b/src/fsfw/osal/common/TcpTmTcServer.cpp
@@ -161,7 +161,7 @@ void TcpTmTcServer::handleServerOperation(socket_t& connSocket) {
while (true) {
ssize_t retval = recv(connSocket, reinterpret_cast(receptionBuffer.data()),
- receptionBuffer.capacity(), tcpConfig.tcpFlags);
+ receptionBuffer.capacity(), tcpConfig.tcpFlags);
if (retval == 0) {
size_t availableReadData = ringBuffer.getAvailableReadData();
if (availableReadData > lastRingBufferSize) {
@@ -285,7 +285,7 @@ ReturnValue_t TcpTmTcServer::handleTmSending(socket_t connSocket, bool& tmSent)
arrayprinter::print(storeAccessor.data(), storeAccessor.size());
}
ssize_t retval = send(connSocket, reinterpret_cast(storeAccessor.data()),
- storeAccessor.size(), tcpConfig.tcpTmFlags);
+ storeAccessor.size(), tcpConfig.tcpTmFlags);
if (retval == static_cast(storeAccessor.size())) {
// Packet sent, clear FIFO entry
tmtcBridge->tmFifo->pop();
@@ -340,7 +340,7 @@ ReturnValue_t TcpTmTcServer::handleTcRingBufferData(size_t availableReadData) {
size_t foundSize = 0;
size_t readLen = 0;
while (readLen < readAmount) {
- if(spacePacketParser == nullptr) {
+ if (spacePacketParser == nullptr) {
return HasReturnvaluesIF::RETURN_FAILED;
}
result =
diff --git a/src/fsfw/osal/common/UdpTcPollingTask.cpp b/src/fsfw/osal/common/UdpTcPollingTask.cpp
index 38fb1921..bcc8e9e3 100644
--- a/src/fsfw/osal/common/UdpTcPollingTask.cpp
+++ b/src/fsfw/osal/common/UdpTcPollingTask.cpp
@@ -154,7 +154,7 @@ void UdpTcPollingTask::setTimeout(double timeoutSeconds) {
#endif
}
#elif defined(PLATFORM_UNIX)
- timeval tval {};
+ timeval tval{};
tval = timevalOperations::toTimeval(timeoutSeconds);
int result = setsockopt(serverSocket, SOL_SOCKET, SO_RCVTIMEO, &tval, sizeof(receptionTimeout));
if (result == -1) {
diff --git a/src/fsfw/osal/common/UdpTmTcBridge.cpp b/src/fsfw/osal/common/UdpTmTcBridge.cpp
index 6089f266..e3cad58f 100644
--- a/src/fsfw/osal/common/UdpTmTcBridge.cpp
+++ b/src/fsfw/osal/common/UdpTmTcBridge.cpp
@@ -20,7 +20,7 @@
const std::string UdpTmTcBridge::DEFAULT_SERVER_PORT = tcpip::DEFAULT_SERVER_PORT;
UdpTmTcBridge::UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
- const std::string& udpServerPort_, object_id_t tmStoreId,
+ const std::string &udpServerPort_, object_id_t tmStoreId,
object_id_t tcStoreId)
: TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) {
if (udpServerPort_.empty()) {
@@ -118,7 +118,7 @@ ReturnValue_t UdpTmTcBridge::sendTm(const uint8_t *data, size_t dataLen) {
#endif
ssize_t bytesSent = sendto(serverSocket, reinterpret_cast(data), dataLen, flags,
- &clientAddress, clientAddressLen);
+ &clientAddress, clientAddressLen);
if (bytesSent == SOCKET_ERROR) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "TmTcUdpBridge::sendTm: Send operation failed." << std::endl;
diff --git a/src/fsfw/osal/common/UdpTmTcBridge.h b/src/fsfw/osal/common/UdpTmTcBridge.h
index b0a67430..92829c46 100644
--- a/src/fsfw/osal/common/UdpTmTcBridge.h
+++ b/src/fsfw/osal/common/UdpTmTcBridge.h
@@ -29,8 +29,8 @@ class UdpTmTcBridge : public TmTcBridge, public TcpIpBase {
/* The ports chosen here should not be used by any other process. */
static const std::string DEFAULT_SERVER_PORT;
- UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination, const std::string& udpServerPort = "",
- object_id_t tmStoreId = objects::TM_STORE,
+ UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
+ const std::string& udpServerPort = "", object_id_t tmStoreId = objects::TM_STORE,
object_id_t tcStoreId = objects::TC_STORE);
~UdpTmTcBridge() override;
diff --git a/src/fsfw/pus/CService201HealthCommanding.cpp b/src/fsfw/pus/CService201HealthCommanding.cpp
index f6c49cd3..644e0d7c 100644
--- a/src/fsfw/pus/CService201HealthCommanding.cpp
+++ b/src/fsfw/pus/CService201HealthCommanding.cpp
@@ -97,7 +97,8 @@ ReturnValue_t CService201HealthCommanding::handleReply(const CommandMessage *rep
}
// Not used for now, health state already reported by event
-[[maybe_unused]] ReturnValue_t CService201HealthCommanding::prepareHealthSetReply(const CommandMessage *reply) {
+[[maybe_unused]] ReturnValue_t CService201HealthCommanding::prepareHealthSetReply(
+ const CommandMessage *reply) {
auto health = static_cast(HealthMessage::getHealth(reply));
auto oldHealth = static_cast(HealthMessage::getOldHealth(reply));
HealthSetReply healthSetReply(health, oldHealth);
diff --git a/src/fsfw/pus/CService201HealthCommanding.h b/src/fsfw/pus/CService201HealthCommanding.h
index 7ffa06d2..71b7caa0 100644
--- a/src/fsfw/pus/CService201HealthCommanding.h
+++ b/src/fsfw/pus/CService201HealthCommanding.h
@@ -39,7 +39,7 @@ class CService201HealthCommanding : public CommandingServiceBase {
private:
static ReturnValue_t checkInterfaceAndAcquireMessageQueue(MessageQueueId_t *MessageQueueToSet,
- const object_id_t *objectId);
+ const object_id_t *objectId);
[[maybe_unused]] ReturnValue_t prepareHealthSetReply(const CommandMessage *reply);
diff --git a/tests/src/fsfw_tests/unit/power/testPowerSwitcher.cpp b/tests/src/fsfw_tests/unit/power/testPowerSwitcher.cpp
index d8523558..941055ac 100644
--- a/tests/src/fsfw_tests/unit/power/testPowerSwitcher.cpp
+++ b/tests/src/fsfw_tests/unit/power/testPowerSwitcher.cpp
@@ -67,7 +67,5 @@ TEST_CASE("Power Switcher", "[power-switcher]") {
REQUIRE(not switcherUsingDummy.active());
}
- SECTION("More Dummy Tests") {
-
- }
+ SECTION("More Dummy Tests") {}
}