Skip to content

Commit

Permalink
Change based on PR review
Browse files Browse the repository at this point in the history
Signed-off-by: Cervenka Dusan <[email protected]>
  • Loading branch information
Hadatko committed Sep 22, 2023
1 parent a9ed103 commit b920699
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/infra/erpc_client_server_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/infra/erpc_codec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "erpc_message_buffer.hpp"
#include "erpc_transport.hpp"

#include <cstring>
#include <cstdint>
#include <cstring>

/*!
* @addtogroup infra_codec
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/infra/erpc_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/infra/erpc_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/port/erpc_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion erpc_c/setup/erpc_transport_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
3 changes: 2 additions & 1 deletion erpc_c/transports/erpc_dspi_slave_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "erpc_dspi_slave_transport.hpp"

#include <cstdio>
#include <new>
#include "erpc_dspi_slave_transport.hpp"

extern "C" {
#include "board.h"
Expand Down
3 changes: 2 additions & 1 deletion erpc_c/transports/erpc_i2c_slave_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "erpc_i2c_slave_transport.hpp"

#include <cstdio>
#include <new>
#include "erpc_i2c_slave_transport.hpp"

extern "C" {
#include "board.h"
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_i2c_slave_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef _EMBEDDED_RPC__I2C_SLAVE_TRANSPORT_H_
#define _EMBEDDED_RPC__I2C_SLAVE_TRANSPORT_H_

#include <cstdlib>
#include "erpc_config_internal.h"
#include <cstdlib>
#if ERPC_THREADS
#include "erpc_threading.h"
#endif
Expand Down
3 changes: 2 additions & 1 deletion erpc_c/transports/erpc_mu_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_rpmsg_linux_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_rpmsg_lite_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion erpc_c/transports/erpc_spi_master_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include <cstdio>
#include "erpc_spi_master_transport.hpp"

#include <cstdio>

extern "C" {
#include "board.h"
#include "fsl_gpio.h"
Expand Down
3 changes: 2 additions & 1 deletion erpc_c/transports/erpc_spi_master_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
#ifndef _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_
#define _EMBEDDED_RPC__SPI_MASTER_TRANSPORT_H_

#include "erpc_framed_transport.hpp"

#include <cstdbool>
#include <cstdlib>
#include "erpc_framed_transport.hpp"

extern "C" {
#include "fsl_spi.h"
Expand Down
3 changes: 2 additions & 1 deletion erpc_c/transports/erpc_spi_slave_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "erpc_spi_slave_transport.hpp"

#include <cstdio>
#include <new>
#include "erpc_spi_slave_transport.hpp"

extern "C" {
#include "board.h"
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_spi_slave_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#ifndef _EMBEDDED_RPC__SPI_SLAVE_TRANSPORT_H_
#define _EMBEDDED_RPC__SPI_SLAVE_TRANSPORT_H_

#include <cstdlib>
#include "erpc_config_internal.h"
#include <cstdlib>
#if ERPC_THREADS
#include "erpc_threading.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion erpc_c/transports/erpc_usb_cdc_transport.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#ifndef _EMBEDDED_RPC__USB_CDC_TRANSPORT_H_
#define _EMBEDDED_RPC__USB_CDC_TRANSPORT_H_

#include <cstdio>
#include "erpc_config_internal.h"
#include <cstdio>
#if !ERPC_THREADS_IS(NONE)
#include "erpc_threading.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion erpcgen/src/Generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Generator
{
kC,
kPython
}; /*!< Type of generator. */
}; /*!< Type of generator. */

typedef std::vector<DataType *> datatype_vector_t; /*!< Vector of data types. */

Expand Down
9 changes: 5 additions & 4 deletions test/common/unit_test_arbitrator_app0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -237,8 +238,8 @@ int main(void)
{
int fake_argc = 1;
const auto fake_arg0 = "dummy";
char* fake_argv0 = const_cast<char*>(fake_arg0);
char** fake_argv = &fake_argv0;
char *fake_argv0 = const_cast<char *>(fake_arg0);
char **fake_argv = &fake_argv0;
::testing::InitGoogleTest(&fake_argc, fake_argv);
BOARD_InitHardware();

Expand Down
5 changes: 3 additions & 2 deletions test/common/unit_test_arbitrator_app1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 10 additions & 9 deletions test/common/unit_test_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -112,8 +113,8 @@ int main(void)
{
int fake_argc = 1;
const auto fake_arg0 = "dummy";
char* fake_argv0 = const_cast<char*>(fake_arg0);
char** fake_argv = &fake_argv0;
char *fake_argv0 = const_cast<char *>(fake_arg0);
char **fake_argv = &fake_argv0;
::testing::InitGoogleTest(&fake_argc, fake_argv);

::testing::TestEventListeners &listeners = ::testing::UnitTest::GetInstance()->listeners();
Expand Down
13 changes: 8 additions & 5 deletions test/common/unit_test_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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"

////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit b920699

Please sign in to comment.