Skip to content

Commit 5c2c6b7

Browse files
McuxCIBotMichalPrincNXP
authored andcommitted
Apply 1.13.0 release update
1 parent 4630822 commit 5c2c6b7

File tree

282 files changed

+8374
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+8374
-128
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ boost*/
112112
mingw.7z
113113
mingw64/
114114
vs_BuildTools*
115+
116+
# Zephyr's repo link
117+
__repo__/

SW-Content-Register.txt

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Release Name: eRPC
2+
Release Version: 1.12.0
3+
Package License: BSD-3-Clause
4+
5+
the_bus_pirate Name: The Bus Pirate
6+
Version: NA
7+
Outgoing License: Open Source - CC0 (Public Domain
8+
Dedication License)
9+
License File: http://code.google.com/p/the-bus-pirate/
10+
Format: source code
11+
Description: OS independent serial interface
12+
Location:
13+
erpc_c/port/erpc_serial.h,
14+
erpc_c/port/erpc_serial.cpp
15+
Origin: Community
16+
Url: http://code.google.com/p/the-bus-pirate/
17+
18+
cpp_template Name: CPP Template
19+
Version: NA
20+
Outgoing License: Open Source - MIT
21+
License File:
22+
erpcgen/src/cpptemplate/LICENSE.txt
23+
Format: source code
24+
Description: CPP Template
25+
Location: erpcgen/src/cpptemplate
26+
Origin: Ryan Ginstrom & Martinho Fernandes
27+
28+
cpp_option_parser Name: C++ option-parser
29+
Version: NA
30+
Outgoing License: Brad Appleton's license
31+
License File: http://www.bradapp.com/ftp/src/libs/C++/Options.tar.gz
32+
, see README file
33+
Format: Plain Text
34+
Description: C++ option-parser
35+
Location: erpcgen/src/options.cpp
36+
Origin: Brad Appleton [email protected]
37+
Url: http://www.bradapp.com/ftp/src/libs/C++/Options.html

doxygen/Doxyfile.erpc

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC API Reference"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "Rev. 1.12.0"
41+
PROJECT_NUMBER = "Rev. 1.13.0"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

doxygen/Doxyfile.erpcgen

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC Generator (erpcgen)"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "Rev. 1.12.0"
41+
PROJECT_NUMBER = "Rev. 1.13.0"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

erpc_c/infra/erpc_version.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2023 NXP
3+
* Copyright 2016-2024 NXP
44
* All rights reserved.
55
*
66
*
@@ -20,9 +20,9 @@
2020
////////////////////////////////////////////////////////////////////////////////
2121

2222
//! @brief String version of eRPC.
23-
#define ERPC_VERSION "1.12.0"
23+
#define ERPC_VERSION "1.13.0"
2424
//! @brief Integer version of eRPC.
25-
#define ERPC_VERSION_NUMBER 11200
25+
#define ERPC_VERSION_NUMBER 11300
2626

2727
/*! @} */
2828

erpc_c/port/erpc_serial.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ int serial_read(int fd, char *buf, int size)
220220

221221
ClearCommError(hCom, &errors, NULL);
222222

223-
if (!ReadFile(hCom, temp, RX_BUF_BYTES - bytesToRead, &bytesRead, &s_readOverlap))
223+
if (!ReadFile(hCom, temp, size - bytesToRead, &bytesRead, &s_readOverlap))
224224
{
225225
if (GetLastError() == ERROR_IO_PENDING)
226226
{
+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
* Copyright 2023 NXP
3+
*
4+
*
5+
* SPDX-License-Identifier: BSD-3-Clause
6+
*/
7+
8+
#include "erpc_manually_constructed.hpp"
9+
#include "erpc_transport_setup.h"
10+
#include "erpc_mbox_zephyr_transport.hpp"
11+
12+
using namespace erpc;
13+
14+
////////////////////////////////////////////////////////////////////////////////
15+
// Variables
16+
////////////////////////////////////////////////////////////////////////////////
17+
18+
ERPC_MANUALLY_CONSTRUCTED_STATIC(MBOXTransport, s_transport);
19+
20+
////////////////////////////////////////////////////////////////////////////////
21+
// Code
22+
////////////////////////////////////////////////////////////////////////////////
23+
24+
erpc_transport_t erpc_transport_zephyr_mbox_init(void *dev, void *tx_channel, void *rx_channel)
25+
{
26+
erpc_transport_t transport;
27+
MBOXTransport *mboxTransport;
28+
29+
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
30+
if (s_transport.isUsed())
31+
{
32+
mboxTransport = NULL;
33+
}
34+
else
35+
{
36+
s_transport.construct((struct device *)dev, (struct mbox_channel *)tx_channel,
37+
(struct mbox_channel *)rx_channel);
38+
mboxTransport = s_transport.get();
39+
}
40+
41+
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
42+
mboxTransport =
43+
new MBOXTransport((struct device *)dev, (struct mbox_channel *)tx_channel, (struct mbox_channel *)rx_channel);
44+
#else
45+
#error "Unknown eRPC allocation policy!"
46+
#endif
47+
48+
transport = reinterpret_cast<erpc_transport_t>(mboxTransport);
49+
50+
if (mboxTransport != NULL)
51+
{
52+
if (mboxTransport->init() != kErpcStatus_Success)
53+
{
54+
erpc_transport_zephyr_mbox_deinit(transport);
55+
transport = NULL;
56+
}
57+
}
58+
59+
return transport;
60+
}
61+
62+
void erpc_transport_zephyr_mbox_deinit(erpc_transport_t transport)
63+
{
64+
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
65+
(void)transport;
66+
s_transport.destroy();
67+
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
68+
erpc_assert(transport != NULL);
69+
70+
MBOXTransport *mboxTransport = reinterpret_cast<MBOXTransport *>(transport);
71+
72+
delete mboxTransport;
73+
#endif
74+
}

erpc_c/setup/erpc_setup_uart_zephyr.cpp

+37-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using namespace erpc;
1515
// Variables
1616
////////////////////////////////////////////////////////////////////////////////
1717

18-
ERPC_MANUALLY_CONSTRUCTED(UartTransport, s_transport);
18+
ERPC_MANUALLY_CONSTRUCTED_STATIC(UartTransport, s_transport);
1919

2020
////////////////////////////////////////////////////////////////////////////////
2121
// Code
@@ -24,16 +24,48 @@ ERPC_MANUALLY_CONSTRUCTED(UartTransport, s_transport);
2424
erpc_transport_t erpc_transport_zephyr_uart_init(void *dev)
2525
{
2626
erpc_transport_t transport;
27+
UartTransport *uartTransport;
2728

28-
s_transport.construct((struct device *)dev);
29-
if (s_transport->init() == kErpcStatus_Success)
29+
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
30+
if (s_transport.isUsed())
3031
{
31-
transport = reinterpret_cast<erpc_transport_t>(s_transport.get());
32+
uartTransport = NULL;
3233
}
3334
else
3435
{
35-
transport = NULL;
36+
s_transport.construct(reinterpret_cast<struct device *>(dev));
37+
uartTransport = s_transport.get();
38+
}
39+
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
40+
uartTransport = new UartTransport(reinterpret_cast<struct device *>(dev));
41+
#else
42+
#error "Unknown eRPC allocation policy!"
43+
#endif
44+
45+
transport = reinterpret_cast<erpc_transport_t>(uartTransport);
46+
47+
if (uartTransport != NULL)
48+
{
49+
if (uartTransport->init() != kErpcStatus_Success)
50+
{
51+
erpc_transport_zephyr_uart_deinit(transport);
52+
transport = NULL;
53+
}
3654
}
3755

3856
return transport;
3957
}
58+
59+
void erpc_transport_zephyr_uart_deinit(erpc_transport_t transport)
60+
{
61+
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
62+
(void)transport;
63+
s_transport.destroy();
64+
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
65+
erpc_assert(transport != NULL);
66+
67+
UartTransport *uartTransport = reinterpret_cast<UartTransport *>(transport);
68+
69+
delete uartTransport;
70+
#endif
71+
}

erpc_c/setup/erpc_transport_setup.h

+34-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2022 NXP
3+
* Copyright 2016-2024 NXP
44
* Copyright 2019 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -508,6 +508,11 @@ erpc_transport_t erpc_transport_cmsis_uart_init(void *uartDrv);
508508
*/
509509
void erpc_transport_cmsis_uart_deinit(erpc_transport_t transport);
510510

511+
//@}
512+
513+
//! @name Zephyr transports setup
514+
//@{
515+
511516
/*!
512517
* @brief Create a Zephyr UART transport.
513518
*
@@ -520,6 +525,34 @@ void erpc_transport_cmsis_uart_deinit(erpc_transport_t transport);
520525
*/
521526
erpc_transport_t erpc_transport_zephyr_uart_init(void *dev);
522527

528+
/*!
529+
* @brief Deinitialize Zephyr UART transport.
530+
*
531+
* @param[in] transport Transport which was initialized with init function.
532+
*/
533+
void erpc_transport_zephyr_uart_deinit(erpc_transport_t transport);
534+
535+
/*!
536+
* @brief Create a Zephyr MBOX transport.
537+
*
538+
* Create a Zephyr MBOX transport instance, to be used on both the server
539+
* and the client side.
540+
*
541+
* @param[in] dev Zephyr MBOX device address.
542+
* @param[in] tx_channel Zephyr MBOX transmit channel.
543+
* @param[in] rx_channel Zephyr MBOX receive channel.
544+
*
545+
* @return Return NULL or erpc_transport_t instance pointer.
546+
*/
547+
erpc_transport_t erpc_transport_zephyr_mbox_init(void *dev, void *tx_channel, void *rx_channel);
548+
549+
/*!
550+
* @brief Deinitialize Zephyr MBOX transport.
551+
*
552+
* @param[in] transport Transport which was initialized with init function.
553+
*/
554+
void erpc_transport_zephyr_mbox_deinit(erpc_transport_t transport);
555+
523556
//@}
524557

525558
//! @name USB CDC transport setup

0 commit comments

Comments
 (0)