Skip to content

Commit f7daaaf

Browse files
clang-format exclude list correction and sources reformat
Signed-off-by: Michal Princ <michal.princ@nxp.com>
1 parent 9beb3c0 commit f7daaaf

19 files changed

Lines changed: 55 additions & 62 deletions

File tree

.github/workflows/clang-format.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,12 @@ jobs:
1111
- uses: DoozyX/clang-format-lint-action@v0.16.2
1212
with:
1313
source: '.'
14-
exclude: './examples/zephyr/matrix_multiply_rpmsglite/remote/src/service ./examples/zephyr/matrix_multiply_rpmsglite/src/service ./examples/zephyr/matrix_multiply_uart/src/service'
14+
exclude: "./examples/zephyr/matrix_multiply_mbox/remote/src/service,
15+
./examples/zephyr/matrix_multiply_mbox/src/service,
16+
./examples/zephyr/matrix_multiply_rpmsglite/remote/src/service,
17+
./examples/zephyr/matrix_multiply_rpmsglite/src/service,
18+
./examples/zephyr/matrix_multiply_tcp/src/service,
19+
./examples/zephyr/matrix_multiply_uart/src/service,
20+
./examples/MCUXPRESSO_SDK/erpc_matrix_multiply/service,
21+
./examples/MCUXPRESSO_SDK/erpc_two_way_rpc/service"
1522
clangFormatVersion: 16

erpc_c/transports/erpc_mu_transport.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ extern "C" {
4848
#define MU_REG_COUNT (MU_RR_COUNT) /*!< Count of MU tx/rx registers to be used by this transport layer */
4949
#endif /* ERPC_TRANSPORT_MU_USE_MCMGR */
5050

51-
#if (defined(MIMXRT1187_cm7_SERIES) || defined(MIMXRT1187_cm33_SERIES) || \
52-
defined(MIMXRT1189_cm7_SERIES) || defined(MIMXRT1189_cm33_SERIES) || \
53-
defined(MIMXRT798S_cm33_core0_SERIES) || defined(MIMXRT798S_cm33_core1_SERIES))
51+
#if (defined(MIMXRT1187_cm7_SERIES) || defined(MIMXRT1187_cm33_SERIES) || defined(MIMXRT1189_cm7_SERIES) || \
52+
defined(MIMXRT1189_cm33_SERIES) || defined(MIMXRT798S_cm33_core0_SERIES) || \
53+
defined(MIMXRT798S_cm33_core1_SERIES))
5454
#define MU_TX_SHIFT (1UL << (MU_REG_COUNT - 1U))
5555
#define MU_RX_SHIFT (1UL << (MU_REG_COUNT - 1U))
5656
#define MU_RX_INTR_MASK (MU_RX_INTR(MU_RX_SHIFT))

examples/hello_world/c/main_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ int main()
3030
initTextService_client(client_manager);
3131

3232
/* Do eRPC call */
33-
if (printText("Hello world!")) {
33+
if (printText("Hello world!"))
34+
{
3435
printf("Message received by server.");
3536
}
3637

examples/matrix_multiply_tcp_c/main_client.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
/*******************************************************************************
1919
* Definitions
2020
******************************************************************************/
21-
#define MATRIX_ITEM_MAX_VALUE (50)
22-
21+
#define MATRIX_ITEM_MAX_VALUE (50)
2322

2423
/*******************************************************************************
2524
* Code
@@ -62,7 +61,7 @@ static void print_matrix(Matrix matrix_ptr)
6261

6362
int main()
6463
{
65-
Matrix matrix1 = {0}, matrix2 = {0}, result_matrix = {0};
64+
Matrix matrix1 = { 0 }, matrix2 = { 0 }, result_matrix = { 0 };
6665

6766
erpc_transport_t transport;
6867
erpc_mbf_t message_buffer_factory;
@@ -77,7 +76,7 @@ int main()
7776
initMatrixMultiplyService_client(client_manager);
7877

7978
char option;
80-
do
79+
do
8180
{
8281
/* Do eRPC call */
8382
fill_matrices(matrix1, matrix2);
@@ -99,8 +98,9 @@ int main()
9998
print_matrix(result_matrix);
10099

101100
printf("Press Enter to initiate the next matrix multiplication or 'q' to quit\n");
102-
option = getchar ();
103-
while(option != '\n' && getchar() != '\n');
101+
option = getchar();
102+
while (option != '\n' && getchar() != '\n')
103+
;
104104
} while (option != 'q');
105105

106106
quitServer();

examples/matrix_multiply_tcp_c/main_client.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
#include <iomanip>
1818
#include <cstdlib>
1919

20-
2120
using namespace erpcShim;
2221
using namespace erpc;
2322

2423
////////////////////////////////////////////////////////////////////////////////
2524
// Definitions
2625
////////////////////////////////////////////////////////////////////////////////
27-
#define MATRIX_ITEM_MAX_VALUE (50)
26+
#define MATRIX_ITEM_MAX_VALUE (50)
2827

2928
////////////////////////////////////////////////////////////////////////////////
3029
// Classes
@@ -90,7 +89,7 @@ static void print_matrix(Matrix matrix_ptr)
9089

9190
int main()
9291
{
93-
Matrix matrix1 = {0}, matrix2 = {0}, result_matrix = {0};
92+
Matrix matrix1 = { 0 }, matrix2 = { 0 }, result_matrix = { 0 };
9493

9594
erpc_status_t status;
9695

@@ -131,23 +130,22 @@ int main()
131130
std::cout << std::endl << "Matrix #2" << std::endl << "=========" << std::endl;
132131
print_matrix(matrix2);
133132

134-
135133
/* Do eRPC call */
136134
std::cout << "eRPC request is sent to the server" << std::endl;
137135
client.erpcMatrixMultiply(matrix1, matrix2, result_matrix);
138136

139-
140137
std::cout << std::endl << "Result matrix" << std::endl << "=========" << std::endl;
141138
print_matrix(result_matrix);
142139

143140
std::cout << "Press Enter to initiate the next matrix multiplication or 'q' to quit: ";
144141
std::getline(std::cin, choice);
145142

146-
if (choice == "q") {
143+
if (choice == "q")
144+
{
147145
break;
148146
}
149147
}
150-
148+
151149
client.quitServer();
152150

153151
/* Deinit objects */

examples/matrix_multiply_tcp_c/main_server.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void erpcMatrixMultiply(Matrix matrix1, Matrix matrix2, Matrix result_matrix)
5959
}
6060

6161
/*!
62-
* @brief Stop the server
62+
* @brief Stop the server
6363
*/
6464
void quitServer()
6565
{
@@ -96,7 +96,7 @@ int main()
9696
erpc_error_handler(err, 0);
9797
}
9898
}
99-
99+
100100
/* Deinit objects */
101101
destroy_MatrixMultiplyService_service(service);
102102
erpc_server_deinit(server);

examples/matrix_multiply_tcp_c/main_server.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ class MatrixMultiplyService : public MatrixMultiplyService_interface
7575
}
7676
}
7777

78-
void quitServer()
79-
{
80-
g_runServer = false;
81-
}
78+
void quitServer() { g_runServer = false; }
8279
};
8380

8481
////////////////////////////////////////////////////////////////////////////////
@@ -131,7 +128,7 @@ int main()
131128
erpc_error_handler(status, 0);
132129
}
133130
}
134-
131+
135132
/* Close transport */
136133
transport.close();
137134
}

examples/zephyr/matrix_multiply_mbox/remote/src/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "erpc_mbox_zephyr_transport.hpp"
1212
#include "erpc_error_handler.h"
1313

14-
1514
#include "erpc_matrix_multiply_common.h"
1615
#include "c_erpc_matrix_multiply_server.h"
1716

@@ -79,7 +78,6 @@ int main(void)
7978
dev = DEVICE_DT_GET(DT_NODELABEL(mbox));
8079
printk("REMOTE: MTU %d\n", mbox_mtu_get(dev));
8180

82-
8381
/* MBOX transport layer initialization */
8482
mbox_init_channel(&tx_channel, dev, TX_ID);
8583
mbox_init_channel(&rx_channel, dev, RX_ID);

examples/zephyr/matrix_multiply_mbox/src/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#include "c_erpc_matrix_multiply_client.h"
1414
#include "erpc_matrix_multiply_common.h"
1515

16-
17-
1816
/*******************************************************************************
1917
* Definitions
2018
******************************************************************************/

examples/zephyr/matrix_multiply_tcp/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int main(void)
6969
/* TCP transport layer initialization */
7070
erpc_transport_t transport;
7171
transport = erpc_transport_tcp_init("localhost", 12345, true);
72-
72+
7373
/* MessageBufferFactory initialization */
7474
erpc_mbf_t message_buffer_factory;
7575
message_buffer_factory = erpc_mbf_dynamic_init();

0 commit comments

Comments
 (0)