diff --git a/.clang-format b/.clang-format index eeed4bea..c2333882 100644 --- a/.clang-format +++ b/.clang-format @@ -63,7 +63,7 @@ BraceWrapping: AfterUnion: true BeforeCatch: true BeforeElse: true -#IncludeBlocks: "Preserve" # for future version of clang +IncludeBlocks: "Preserve" # for future version of clang IncludeCategories: - Regex: "^<" # system includes Priority: 10 diff --git a/erpc_c/infra/erpc_client_server_common.hpp b/erpc_c/infra/erpc_client_server_common.hpp index 9369f775..68ee2a94 100644 --- a/erpc_c/infra/erpc_client_server_common.hpp +++ b/erpc_c/infra/erpc_client_server_common.hpp @@ -10,8 +10,8 @@ #ifndef _EMBEDDED_RPC__CLIENTSERVERCOMMON_H_ #define _EMBEDDED_RPC__CLIENTSERVERCOMMON_H_ -#include "erpc_config_internal.h" #include "erpc_codec.hpp" +#include "erpc_config_internal.h" #if ERPC_MESSAGE_LOGGING #include "erpc_message_loggers.hpp" #endif diff --git a/erpc_c/infra/erpc_codec.hpp b/erpc_c/infra/erpc_codec.hpp index 5c81a75c..c436f38b 100644 --- a/erpc_c/infra/erpc_codec.hpp +++ b/erpc_c/infra/erpc_codec.hpp @@ -15,8 +15,8 @@ #include "erpc_message_buffer.hpp" #include "erpc_transport.hpp" -#include #include +#include /*! * @addtogroup infra_codec diff --git a/erpc_c/infra/erpc_server.hpp b/erpc_c/infra/erpc_server.hpp index 8c686a90..ea0ea203 100644 --- a/erpc_c/infra/erpc_server.hpp +++ b/erpc_c/infra/erpc_server.hpp @@ -143,7 +143,7 @@ class Server : public ClientServerCommon virtual void stop(void) = 0; protected: - Service *m_firstService; /*!< Contains pointer to first service. */ + Service *m_firstService; /*!< Contains pointer to first service. */ /*! * @brief Process message. diff --git a/erpc_c/infra/erpc_utils.cpp b/erpc_c/infra/erpc_utils.cpp index 19c3b391..f59acbb6 100644 --- a/erpc_c/infra/erpc_utils.cpp +++ b/erpc_c/infra/erpc_utils.cpp @@ -9,7 +9,7 @@ #include "erpc_utils.hpp" bool erpc::findIndexOfFunction(const arrayOfFunctionPtr_t sourceArrayOfFunctionPtr, uint16_t sourceArrayLength, - const functionPtr_t functionPtr, uint16_t &retVal) + const functionPtr_t functionPtr, uint16_t &retVal) { uint32_t index; bool find = false; diff --git a/erpc_c/port/erpc_serial.cpp b/erpc_c/port/erpc_serial.cpp index 9f94799d..2423ca8e 100644 --- a/erpc_c/port/erpc_serial.cpp +++ b/erpc_c/port/erpc_serial.cpp @@ -135,7 +135,7 @@ int serial_setup(int fd, speed_t speed) #ifdef __APPLE__ return ioctl(fd, IOSSIOSPEED, &speed); -#endif //#ifdef __APPLE__ +#endif // #ifdef __APPLE__ #endif // _WIN32 return 0; diff --git a/erpc_c/setup/erpc_transport_setup.h b/erpc_c/setup/erpc_transport_setup.h index bf36bda6..d72db62f 100644 --- a/erpc_c/setup/erpc_transport_setup.h +++ b/erpc_c/setup/erpc_transport_setup.h @@ -151,7 +151,6 @@ void erpc_transport_lpi2c_slave_deinit(erpc_transport_t transport); */ erpc_transport_t erpc_transport_lpspi_slave_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz); - /*! * @brief Deinitialize LPSPI slave transport. * diff --git a/erpc_c/transports/erpc_dspi_slave_transport.cpp b/erpc_c/transports/erpc_dspi_slave_transport.cpp index 1c5a9487..b0f68a5b 100644 --- a/erpc_c/transports/erpc_dspi_slave_transport.cpp +++ b/erpc_c/transports/erpc_dspi_slave_transport.cpp @@ -8,9 +8,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include "erpc_dspi_slave_transport.hpp" + #include #include -#include "erpc_dspi_slave_transport.hpp" extern "C" { #include "board.h" diff --git a/erpc_c/transports/erpc_i2c_slave_transport.cpp b/erpc_c/transports/erpc_i2c_slave_transport.cpp index 991f864f..7fa3b52a 100644 --- a/erpc_c/transports/erpc_i2c_slave_transport.cpp +++ b/erpc_c/transports/erpc_i2c_slave_transport.cpp @@ -6,9 +6,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include "erpc_i2c_slave_transport.hpp" + #include #include -#include "erpc_i2c_slave_transport.hpp" extern "C" { #include "board.h" diff --git a/erpc_c/transports/erpc_i2c_slave_transport.hpp b/erpc_c/transports/erpc_i2c_slave_transport.hpp index bd10280a..425b2807 100644 --- a/erpc_c/transports/erpc_i2c_slave_transport.hpp +++ b/erpc_c/transports/erpc_i2c_slave_transport.hpp @@ -9,8 +9,8 @@ #ifndef _EMBEDDED_RPC__I2C_SLAVE_TRANSPORT_H_ #define _EMBEDDED_RPC__I2C_SLAVE_TRANSPORT_H_ -#include #include "erpc_config_internal.h" +#include #if ERPC_THREADS #include "erpc_threading.h" #endif diff --git a/erpc_c/transports/erpc_mu_transport.hpp b/erpc_c/transports/erpc_mu_transport.hpp index b2c38afe..16a819e1 100644 --- a/erpc_c/transports/erpc_mu_transport.hpp +++ b/erpc_c/transports/erpc_mu_transport.hpp @@ -48,7 +48,8 @@ extern "C" { #define MU_REG_COUNT (MU_RR_COUNT) /*!< Count of MU tx/rx registers to be used by this transport layer */ #endif /* ERPC_TRANSPORT_MU_USE_MCMGR */ -#if (defined(MIMXRT1187_cm7_SERIES) || defined(MIMXRT1187_cm33_SERIES) || defined(MIMXRT1189_cm7_SERIES) || defined(MIMXRT1189_cm33_SERIES)) +#if (defined(MIMXRT1187_cm7_SERIES) || defined(MIMXRT1187_cm33_SERIES) || defined(MIMXRT1189_cm7_SERIES) || \ + defined(MIMXRT1189_cm33_SERIES)) #define MU_TX_SHIFT (1UL << (MU_REG_COUNT - 1U)) #define MU_RX_SHIFT (1UL << (MU_REG_COUNT - 1U)) #define MU_RX_INTR_MASK (MU_RX_INTR(MU_RX_SHIFT)) diff --git a/erpc_c/transports/erpc_rpmsg_linux_transport.hpp b/erpc_c/transports/erpc_rpmsg_linux_transport.hpp index f849e951..ce13725c 100644 --- a/erpc_c/transports/erpc_rpmsg_linux_transport.hpp +++ b/erpc_c/transports/erpc_rpmsg_linux_transport.hpp @@ -38,7 +38,7 @@ class RPMsgLinuxTransport : public Transport * * @return RPMsgEndpoint * Rpmsg endpoint. */ - RPMsgEndpoint *getRpmsgEndpoint(void){ return m_endPoint; } + RPMsgEndpoint *getRpmsgEndpoint(void) { return m_endPoint; } /*! * @brief This function initializes Linux environment for sending and receiving messages. diff --git a/erpc_c/transports/erpc_rpmsg_lite_transport.hpp b/erpc_c/transports/erpc_rpmsg_lite_transport.hpp index ab4cb3c6..6537eae6 100644 --- a/erpc_c/transports/erpc_rpmsg_lite_transport.hpp +++ b/erpc_c/transports/erpc_rpmsg_lite_transport.hpp @@ -10,8 +10,8 @@ #ifndef _EMBEDDED_RPC__RPMSG_LITE_TRANSPORT_H_ #define _EMBEDDED_RPC__RPMSG_LITE_TRANSPORT_H_ -#include "erpc_crc16.hpp" #include "erpc_config_internal.h" +#include "erpc_crc16.hpp" #include "erpc_message_buffer.hpp" #include "erpc_rpmsg_lite_base_transport.hpp" #include "erpc_static_queue.hpp" diff --git a/erpc_c/transports/erpc_spi_master_transport.cpp b/erpc_c/transports/erpc_spi_master_transport.cpp index da4f36ee..20a216de 100644 --- a/erpc_c/transports/erpc_spi_master_transport.cpp +++ b/erpc_c/transports/erpc_spi_master_transport.cpp @@ -8,9 +8,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include #include "erpc_spi_master_transport.hpp" +#include + extern "C" { #include "board.h" #include "fsl_gpio.h" diff --git a/erpc_c/transports/erpc_spi_master_transport.hpp b/erpc_c/transports/erpc_spi_master_transport.hpp index 8614b623..e90e27a2 100644 --- a/erpc_c/transports/erpc_spi_master_transport.hpp +++ b/erpc_c/transports/erpc_spi_master_transport.hpp @@ -10,9 +10,10 @@ #ifndef _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_ #define _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_ +#include "erpc_framed_transport.hpp" + #include #include -#include "erpc_framed_transport.hpp" extern "C" { #include "fsl_spi.h" diff --git a/erpc_c/transports/erpc_spi_slave_transport.cpp b/erpc_c/transports/erpc_spi_slave_transport.cpp index dadd77de..f4d034b2 100644 --- a/erpc_c/transports/erpc_spi_slave_transport.cpp +++ b/erpc_c/transports/erpc_spi_slave_transport.cpp @@ -8,9 +8,10 @@ * SPDX-License-Identifier: BSD-3-Clause */ +#include "erpc_spi_slave_transport.hpp" + #include #include -#include "erpc_spi_slave_transport.hpp" extern "C" { #include "board.h" diff --git a/erpc_c/transports/erpc_spi_slave_transport.hpp b/erpc_c/transports/erpc_spi_slave_transport.hpp index 4a6de45a..bc4e22b9 100644 --- a/erpc_c/transports/erpc_spi_slave_transport.hpp +++ b/erpc_c/transports/erpc_spi_slave_transport.hpp @@ -10,8 +10,8 @@ #ifndef _EMBEDDED_RPC__SPI_SLAVE_TRANSPORT_H_ #define _EMBEDDED_RPC__SPI_SLAVE_TRANSPORT_H_ -#include #include "erpc_config_internal.h" +#include #if ERPC_THREADS #include "erpc_threading.h" #endif diff --git a/erpc_c/transports/erpc_usb_cdc_transport.hpp b/erpc_c/transports/erpc_usb_cdc_transport.hpp index a32df59d..ee4abf69 100644 --- a/erpc_c/transports/erpc_usb_cdc_transport.hpp +++ b/erpc_c/transports/erpc_usb_cdc_transport.hpp @@ -9,8 +9,8 @@ #ifndef _EMBEDDED_RPC__USB_CDC_TRANSPORT_H_ #define _EMBEDDED_RPC__USB_CDC_TRANSPORT_H_ -#include #include "erpc_config_internal.h" +#include #if !ERPC_THREADS_IS(NONE) #include "erpc_threading.h" #endif diff --git a/erpcgen/src/Generator.hpp b/erpcgen/src/Generator.hpp index 642b0eef..dd9ad734 100644 --- a/erpcgen/src/Generator.hpp +++ b/erpcgen/src/Generator.hpp @@ -49,7 +49,7 @@ class Generator { kC, kPython - }; /*!< Type of generator. */ + }; /*!< Type of generator. */ typedef std::vector datatype_vector_t; /*!< Vector of data types. */ diff --git a/test/common/unit_test_arbitrator_app0.cpp b/test/common/unit_test_arbitrator_app0.cpp index d2506cac..ee20aa6e 100644 --- a/test/common/unit_test_arbitrator_app0.cpp +++ b/test/common/unit_test_arbitrator_app0.cpp @@ -12,11 +12,12 @@ #include "erpc_transport_setup.h" #include "FreeRTOS.h" +#include "semphr.h" +#include "task.h" + #include "c_test_firstInterface_client.h" #include "c_test_secondInterface_server.h" #include "gtest.h" -#include "semphr.h" -#include "task.h" #include "unit_test.h" #ifdef __cplusplus @@ -237,8 +238,8 @@ int main(void) { int fake_argc = 1; const auto fake_arg0 = "dummy"; - char* fake_argv0 = const_cast(fake_arg0); - char** fake_argv = &fake_argv0; + char *fake_argv0 = const_cast(fake_arg0); + char **fake_argv = &fake_argv0; ::testing::InitGoogleTest(&fake_argc, fake_argv); BOARD_InitHardware(); diff --git a/test/common/unit_test_arbitrator_app1.cpp b/test/common/unit_test_arbitrator_app1.cpp index 95a5f4fa..24720b7d 100644 --- a/test/common/unit_test_arbitrator_app1.cpp +++ b/test/common/unit_test_arbitrator_app1.cpp @@ -12,10 +12,11 @@ #include "erpc_transport_setup.h" #include "FreeRTOS.h" -#include "c_test_firstInterface_server.h" -#include "c_test_secondInterface_client.h" #include "semphr.h" #include "task.h" + +#include "c_test_firstInterface_server.h" +#include "c_test_secondInterface_client.h" #include "unit_test.h" #ifdef __cplusplus diff --git a/test/common/unit_test_client.cpp b/test/common/unit_test_client.cpp index 49549121..e685f6cc 100644 --- a/test/common/unit_test_client.cpp +++ b/test/common/unit_test_client.cpp @@ -10,13 +10,6 @@ #include "erpc_mbf_setup.h" #include "erpc_transport_setup.h" -#include "board.h" -#include "c_test_unit_test_common_client.h" -#include "gtest.h" -#include "gtestListener.h" -#include "myAlloc.h" -#include "unit_test_wrapped.h" - #if (defined(RPMSG) || defined(UART) || defined(MU)) extern "C" { #if defined(RPMSG) @@ -32,6 +25,14 @@ int main(void); #endif } +#include "board.h" + +#include "c_test_unit_test_common_client.h" +#include "gtest.h" +#include "gtestListener.hpp" +#include "myAlloc.hpp" +#include "unit_test_wrapped.h" + #ifdef UNITY_DUMP_RESULTS #include "corn_g_test.h" #endif @@ -112,8 +113,8 @@ int main(void) { int fake_argc = 1; const auto fake_arg0 = "dummy"; - char* fake_argv0 = const_cast(fake_arg0); - char** fake_argv = &fake_argv0; + char *fake_argv0 = const_cast(fake_arg0); + char **fake_argv = &fake_argv0; ::testing::InitGoogleTest(&fake_argc, fake_argv); ::testing::TestEventListeners &listeners = ::testing::UnitTest::GetInstance()->listeners(); diff --git a/test/common/unit_test_server.cpp b/test/common/unit_test_server.cpp index 7f2e2890..7c54afa8 100644 --- a/test/common/unit_test_server.cpp +++ b/test/common/unit_test_server.cpp @@ -14,15 +14,17 @@ #if (defined(RPMSG) || defined(UART) || defined(MU)) extern "C" { #if defined(UART) -#include "app_core0.h" #include "fsl_lpuart_cmsis.h" + +#include "app_core0.h" #else #if defined(RPMSG) #include "rpmsg_lite.h" #endif #define APP_ERPC_READY_EVENT_DATA (1) -#include "app_core1.h" #include "mcmgr.h" + +#include "app_core1.h" #endif #if defined(__CC_ARM) || defined(__ARMCC_VERSION) int main(void); @@ -31,8 +33,9 @@ int main(void); #endif #include "board.h" + +#include "c_test_unit_test_common_server.h" #include "myAlloc.hpp" -#include "test_unit_test_common_server.h" #include "unit_test_wrapped.h" //////////////////////////////////////////////////////////////////////////////// @@ -117,9 +120,9 @@ void add_common_service(erpc_server_t server) erpc_add_service_to_server(server, service_common); } -void remove_common_services_from_server(erpc_service_t service) +void remove_common_services_from_server(erpc_server_t server, erpc_service_t service) { - erpc_remove_service_from_server(service); + erpc_remove_service_from_server(server, service); destroy_Common_service(service); }