Skip to content

Commit 8de773b

Browse files
committed
zephyr: Add CONFIG_ERPC_ENDPOINT_NAME
ERPC_ENDPOINT_NAME must be the same for both local and remote sides. Currently, it is set as a local parameters in different places which make it difficult to be aligned between sides. Add a Kconfig for this so that it can be used easily for both remote and server applications. Signed-off-by: Phi Bang Nguyen <phibang.nguyen@nxp.com>
1 parent 538b77a commit 8de773b

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
/*******************************************************************************
1616
* Definitions
1717
******************************************************************************/
18-
#define ERPC_ENDPOINT_NAME "erpc_ept"
19-
#define REMOTE_INIT_DELAY_MS (500U)
2018

2119
/*******************************************************************************
2220
* Prototypes
@@ -79,7 +77,7 @@ int main(void)
7977

8078
/* Zephyr IPC Service transport layer initialization */
8179
printk("Initializing Zephyr IPC Service transport...\r\n");
82-
transport = erpc_transport_zephyr_ipc_remote_init(ERPC_ENDPOINT_NAME, 0);
80+
transport = erpc_transport_zephyr_ipc_remote_init(CONFIG_ERPC_ENDPOINT_NAME, 0);
8381

8482
if (transport == NULL)
8583
{

examples/zephyr/matrix_multiply_ipc_service/src/main.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
/*******************************************************************************
2020
* Definitions
2121
******************************************************************************/
22-
#define ERPC_ENDPOINT_NAME "erpc_ept"
2322
#define MASTER_INIT_DELAY_MS (500U)
2423

2524
#define MATRIX_ITEM_MAX_VALUE (50)
@@ -91,7 +90,7 @@ int main(void)
9190

9291
/* Zephyr IPC Service transport layer initialization */
9392
printk("Initializing Zephyr IPC Service transport...\r\n");
94-
erpc_transport_t transport = erpc_transport_zephyr_ipc_master_init(ERPC_ENDPOINT_NAME, MASTER_INIT_DELAY_MS);
93+
erpc_transport_t transport = erpc_transport_zephyr_ipc_master_init(CONFIG_ERPC_ENDPOINT_NAME, MASTER_INIT_DELAY_MS);
9594

9695
if (transport == NULL)
9796
{

zephyr/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,13 @@ config ERPC_TRANSPORT_IPC_SERVICE
221221
When enabled, eRPC will include IPC Service transport layer.
222222
Uses Zephyr's IPC Service API with RPMsg-Lite backend by default.
223223

224+
config ERPC_ENDPOINT_NAME
225+
string "eRPC endpoint name"
226+
default "erpc_ept"
227+
help
228+
Name of the endpoint to create.
229+
Need to be the same for both local and remote sides.
230+
224231
endmenu
225232

226233
# ============================================================================

0 commit comments

Comments
 (0)