From d2ac3603a5857d4f08c7238b24fb195d8d1f0f3f Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 16 Aug 2022 12:29:53 +0200 Subject: [PATCH] some more occurences --- docs/README-highlevel.md | 2 +- docs/highlevel.rst | 2 +- src/fsfw/osal/linux/Clock.cpp | 2 +- src/fsfw/pus/Service11TelecommandScheduling.h | 6 +++--- src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h | 12 ++++++------ src/fsfw_hal/linux/spi/SpiComIF.h | 6 +++--- src/fsfw_hal/linux/uart/UartComIF.h | 6 +++--- src/fsfw_hal/stm32h7/spi/spiDefinitions.h | 6 +++--- unittests/container/TestDynamicFifo.cpp | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/docs/README-highlevel.md b/docs/README-highlevel.md index 262138a7..9005af8d 100644 --- a/docs/README-highlevel.md +++ b/docs/README-highlevel.md @@ -14,7 +14,7 @@ FSFW to achieve that. The fsfw uses run-time type information but exceptions are # Failure Handling Functions should return a defined `ReturnValue_t` to signal to the caller that something has -gone wrong. Returnvalues must be unique. For this the function `HasReturnvaluesIF::makeReturnCode` +gone wrong. Returnvalues must be unique. For this the function `returnvalue::makeCode` or the macro `MAKE_RETURN` can be used. The `CLASS_ID` is a unique id for that type of object. See `returnvalues/FwClassIds` folder. The user can add custom `CLASS_ID`s via the `fsfwconfig` folder. diff --git a/docs/highlevel.rst b/docs/highlevel.rst index 04eb5e7b..3c9baae2 100644 --- a/docs/highlevel.rst +++ b/docs/highlevel.rst @@ -18,7 +18,7 @@ Failure Handling ----------------- Functions should return a defined :cpp:type:`ReturnValue_t` to signal to the caller that something has -gone wrong. Returnvalues must be unique. For this the function :cpp:func:`HasReturnvaluesIF::makeReturnCode` +gone wrong. Returnvalues must be unique. For this the function :cpp:func:`returnvalue::makeCode` or the :ref:`macro MAKE_RETURN_CODE ` can be used. The ``CLASS_ID`` is a unique ID for that type of object. See the :ref:`FSFW Class IDs file `. The user can add custom ``CLASS_ID``\s via the ``fsfwconfig`` folder. diff --git a/src/fsfw/osal/linux/Clock.cpp b/src/fsfw/osal/linux/Clock.cpp index 2b914f75..a2b6f5bf 100644 --- a/src/fsfw/osal/linux/Clock.cpp +++ b/src/fsfw/osal/linux/Clock.cpp @@ -93,7 +93,7 @@ ReturnValue_t Clock::getUptime(timeval* uptime) { // struct sysinfo sysInfo; // int result = sysinfo(&sysInfo); // if(result != 0){ -// return HasReturnvaluesIF::returnvalue::FAILED; +// return returnvalue::FAILED; // } // return sysInfo.uptime; //} diff --git a/src/fsfw/pus/Service11TelecommandScheduling.h b/src/fsfw/pus/Service11TelecommandScheduling.h index 35ae59e0..2ceacbf7 100644 --- a/src/fsfw/pus/Service11TelecommandScheduling.h +++ b/src/fsfw/pus/Service11TelecommandScheduling.h @@ -38,11 +38,11 @@ class Service11TelecommandScheduling final : public PusServiceBase { static constexpr uint8_t CLASS_ID = CLASS_ID::PUS_SERVICE_11; static constexpr ReturnValue_t INVALID_TYPE_TIME_WINDOW = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 1); + returnvalue::makeCode(CLASS_ID, 1); static constexpr ReturnValue_t TIMESHIFTING_NOT_POSSIBLE = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 2); + returnvalue::makeCode(CLASS_ID, 2); static constexpr ReturnValue_t INVALID_RELATIVE_TIME = - HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3); + returnvalue::makeCode(CLASS_ID, 3); static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_11; diff --git a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h index fff7e3c2..49b15b83 100644 --- a/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h +++ b/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h @@ -20,17 +20,17 @@ class LinuxLibgpioIF : public GpioIF, public SystemObject { static const uint8_t gpioRetvalId = CLASS_ID::HAL_GPIO; static constexpr ReturnValue_t UNKNOWN_GPIO_ID = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 1); + returnvalue::makeCode(gpioRetvalId, 1); static constexpr ReturnValue_t DRIVE_GPIO_FAILURE = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 2); + returnvalue::makeCode(gpioRetvalId, 2); static constexpr ReturnValue_t GPIO_TYPE_FAILURE = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 3); + returnvalue::makeCode(gpioRetvalId, 3); static constexpr ReturnValue_t GPIO_INVALID_INSTANCE = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 4); + returnvalue::makeCode(gpioRetvalId, 4); static constexpr ReturnValue_t GPIO_DUPLICATE_DETECTED = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 5); + returnvalue::makeCode(gpioRetvalId, 5); static constexpr ReturnValue_t GPIO_INIT_FAILED = - HasReturnvaluesIF::makeReturnCode(gpioRetvalId, 6); + returnvalue::makeCode(gpioRetvalId, 6); LinuxLibgpioIF(object_id_t objectId); virtual ~LinuxLibgpioIF(); diff --git a/src/fsfw_hal/linux/spi/SpiComIF.h b/src/fsfw_hal/linux/spi/SpiComIF.h index 357afa2f..d3b361a9 100644 --- a/src/fsfw_hal/linux/spi/SpiComIF.h +++ b/src/fsfw_hal/linux/spi/SpiComIF.h @@ -24,13 +24,13 @@ class SpiComIF : public DeviceCommunicationIF, public SystemObject { public: static constexpr uint8_t spiRetvalId = CLASS_ID::HAL_SPI; static constexpr ReturnValue_t OPENING_FILE_FAILED = - HasReturnvaluesIF::makeReturnCode(spiRetvalId, 0); + returnvalue::makeCode(spiRetvalId, 0); /* Full duplex (ioctl) transfer failure */ static constexpr ReturnValue_t FULL_DUPLEX_TRANSFER_FAILED = - HasReturnvaluesIF::makeReturnCode(spiRetvalId, 1); + returnvalue::makeCode(spiRetvalId, 1); /* Half duplex (read/write) transfer failure */ static constexpr ReturnValue_t HALF_DUPLEX_TRANSFER_FAILED = - HasReturnvaluesIF::makeReturnCode(spiRetvalId, 2); + returnvalue::makeCode(spiRetvalId, 2); SpiComIF(object_id_t objectId, GpioIF* gpioComIF); diff --git a/src/fsfw_hal/linux/uart/UartComIF.h b/src/fsfw_hal/linux/uart/UartComIF.h index 224f1e77..870d02c5 100644 --- a/src/fsfw_hal/linux/uart/UartComIF.h +++ b/src/fsfw_hal/linux/uart/UartComIF.h @@ -23,11 +23,11 @@ class UartComIF : public DeviceCommunicationIF, public SystemObject { static constexpr uint8_t uartRetvalId = CLASS_ID::HAL_UART; static constexpr ReturnValue_t UART_READ_FAILURE = - HasReturnvaluesIF::makeReturnCode(uartRetvalId, 1); + returnvalue::makeCode(uartRetvalId, 1); static constexpr ReturnValue_t UART_READ_SIZE_MISSMATCH = - HasReturnvaluesIF::makeReturnCode(uartRetvalId, 2); + returnvalue::makeCode(uartRetvalId, 2); static constexpr ReturnValue_t UART_RX_BUFFER_TOO_SMALL = - HasReturnvaluesIF::makeReturnCode(uartRetvalId, 3); + returnvalue::makeCode(uartRetvalId, 3); UartComIF(object_id_t objectId); diff --git a/src/fsfw_hal/stm32h7/spi/spiDefinitions.h b/src/fsfw_hal/stm32h7/spi/spiDefinitions.h index 12c3bf4e..809f5c74 100644 --- a/src/fsfw_hal/stm32h7/spi/spiDefinitions.h +++ b/src/fsfw_hal/stm32h7/spi/spiDefinitions.h @@ -11,9 +11,9 @@ namespace spi { static constexpr uint8_t HAL_SPI_ID = CLASS_ID::HAL_SPI; static constexpr ReturnValue_t HAL_TIMEOUT_RETVAL = - HasReturnvaluesIF::makeReturnCode(HAL_SPI_ID, 0); -static constexpr ReturnValue_t HAL_BUSY_RETVAL = HasReturnvaluesIF::makeReturnCode(HAL_SPI_ID, 1); -static constexpr ReturnValue_t HAL_ERROR_RETVAL = HasReturnvaluesIF::makeReturnCode(HAL_SPI_ID, 2); + returnvalue::makeCode(HAL_SPI_ID, 0); +static constexpr ReturnValue_t HAL_BUSY_RETVAL = returnvalue::makeCode(HAL_SPI_ID, 1); +static constexpr ReturnValue_t HAL_ERROR_RETVAL = returnvalue::makeCode(HAL_SPI_ID, 2); enum class TransferStates { IDLE, WAIT, SUCCESS, FAILURE }; diff --git a/unittests/container/TestDynamicFifo.cpp b/unittests/container/TestDynamicFifo.cpp index 1475b0dc..a3347215 100644 --- a/unittests/container/TestDynamicFifo.cpp +++ b/unittests/container/TestDynamicFifo.cpp @@ -82,8 +82,8 @@ TEST_CASE("Dynamic Fifo Tests", "[TestDynamicFifo]") { REQUIRE(fifo.size() == 0); REQUIRE(fifo.empty()); // struct Test* ptr = nullptr; - // REQUIRE(fifo.retrieve(ptr) == static_cast(HasReturnvaluesIF::returnvalue::FAILED)); - // REQUIRE(fifo.peek(ptr) == static_cast(HasReturnvaluesIF::returnvalue::FAILED)); + // REQUIRE(fifo.retrieve(ptr) == static_cast(returnvalue::FAILED)); + // REQUIRE(fifo.peek(ptr) == static_cast(returnvalue::FAILED)); }; SECTION("Copy Test") { REQUIRE(fifo.insert(structOne) == static_cast(returnvalue::OK));