Skip to content

Commit

Permalink
Apply 1.13.0 release update
Browse files Browse the repository at this point in the history
  • Loading branch information
McuxCIBot authored and MichalPrincNXP committed Jul 2, 2024
1 parent 4630822 commit 5c2c6b7
Show file tree
Hide file tree
Showing 282 changed files with 8,374 additions and 128 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ boost*/
mingw.7z
mingw64/
vs_BuildTools*

# Zephyr's repo link
__repo__/
37 changes: 37 additions & 0 deletions SW-Content-Register.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Release Name: eRPC
Release Version: 1.12.0
Package License: BSD-3-Clause

the_bus_pirate Name: The Bus Pirate
Version: NA
Outgoing License: Open Source - CC0 (Public Domain
Dedication License)
License File: http://code.google.com/p/the-bus-pirate/
Format: source code
Description: OS independent serial interface
Location:
erpc_c/port/erpc_serial.h,
erpc_c/port/erpc_serial.cpp
Origin: Community
Url: http://code.google.com/p/the-bus-pirate/

cpp_template Name: CPP Template
Version: NA
Outgoing License: Open Source - MIT
License File:
erpcgen/src/cpptemplate/LICENSE.txt
Format: source code
Description: CPP Template
Location: erpcgen/src/cpptemplate
Origin: Ryan Ginstrom & Martinho Fernandes

cpp_option_parser Name: C++ option-parser
Version: NA
Outgoing License: Brad Appleton's license
License File: http://www.bradapp.com/ftp/src/libs/C++/Options.tar.gz
, see README file
Format: Plain Text
Description: C++ option-parser
Location: erpcgen/src/options.cpp
Origin: Brad Appleton bradapp@enteract.com
Url: http://www.bradapp.com/ftp/src/libs/C++/Options.html
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.erpc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC API Reference"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 1.12.0"
PROJECT_NUMBER = "Rev. 1.13.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion doxygen/Doxyfile.erpcgen
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "eRPC Generator (erpcgen)"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = "Rev. 1.12.0"
PROJECT_NUMBER = "Rev. 1.13.0"

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
6 changes: 3 additions & 3 deletions erpc_c/infra/erpc_version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2016, Freescale Semiconductor, Inc.
* Copyright 2016-2023 NXP
* Copyright 2016-2024 NXP
* All rights reserved.
*
*
Expand All @@ -20,9 +20,9 @@
////////////////////////////////////////////////////////////////////////////////

//! @brief String version of eRPC.
#define ERPC_VERSION "1.12.0"
#define ERPC_VERSION "1.13.0"
//! @brief Integer version of eRPC.
#define ERPC_VERSION_NUMBER 11200
#define ERPC_VERSION_NUMBER 11300

/*! @} */

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 @@ -220,7 +220,7 @@ int serial_read(int fd, char *buf, int size)

ClearCommError(hCom, &errors, NULL);

if (!ReadFile(hCom, temp, RX_BUF_BYTES - bytesToRead, &bytesRead, &s_readOverlap))
if (!ReadFile(hCom, temp, size - bytesToRead, &bytesRead, &s_readOverlap))
{
if (GetLastError() == ERROR_IO_PENDING)
{
Expand Down
74 changes: 74 additions & 0 deletions erpc_c/setup/erpc_setup_mbox_zephyr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright 2023 NXP
*
*
* SPDX-License-Identifier: BSD-3-Clause
*/

#include "erpc_manually_constructed.hpp"
#include "erpc_transport_setup.h"
#include "erpc_mbox_zephyr_transport.hpp"

using namespace erpc;

////////////////////////////////////////////////////////////////////////////////
// Variables
////////////////////////////////////////////////////////////////////////////////

ERPC_MANUALLY_CONSTRUCTED_STATIC(MBOXTransport, s_transport);

////////////////////////////////////////////////////////////////////////////////
// Code
////////////////////////////////////////////////////////////////////////////////

erpc_transport_t erpc_transport_zephyr_mbox_init(void *dev, void *tx_channel, void *rx_channel)
{
erpc_transport_t transport;
MBOXTransport *mboxTransport;

#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
if (s_transport.isUsed())
{
mboxTransport = NULL;
}
else
{
s_transport.construct((struct device *)dev, (struct mbox_channel *)tx_channel,
(struct mbox_channel *)rx_channel);
mboxTransport = s_transport.get();
}

#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
mboxTransport =
new MBOXTransport((struct device *)dev, (struct mbox_channel *)tx_channel, (struct mbox_channel *)rx_channel);
#else
#error "Unknown eRPC allocation policy!"
#endif

transport = reinterpret_cast<erpc_transport_t>(mboxTransport);

if (mboxTransport != NULL)
{
if (mboxTransport->init() != kErpcStatus_Success)
{
erpc_transport_zephyr_mbox_deinit(transport);
transport = NULL;
}
}

return transport;
}

void erpc_transport_zephyr_mbox_deinit(erpc_transport_t transport)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
(void)transport;
s_transport.destroy();
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
erpc_assert(transport != NULL);

MBOXTransport *mboxTransport = reinterpret_cast<MBOXTransport *>(transport);

delete mboxTransport;
#endif
}
42 changes: 37 additions & 5 deletions erpc_c/setup/erpc_setup_uart_zephyr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace erpc;
// Variables
////////////////////////////////////////////////////////////////////////////////

ERPC_MANUALLY_CONSTRUCTED(UartTransport, s_transport);
ERPC_MANUALLY_CONSTRUCTED_STATIC(UartTransport, s_transport);

////////////////////////////////////////////////////////////////////////////////
// Code
Expand All @@ -24,16 +24,48 @@ ERPC_MANUALLY_CONSTRUCTED(UartTransport, s_transport);
erpc_transport_t erpc_transport_zephyr_uart_init(void *dev)
{
erpc_transport_t transport;
UartTransport *uartTransport;

s_transport.construct((struct device *)dev);
if (s_transport->init() == kErpcStatus_Success)
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
if (s_transport.isUsed())
{
transport = reinterpret_cast<erpc_transport_t>(s_transport.get());
uartTransport = NULL;
}
else
{
transport = NULL;
s_transport.construct(reinterpret_cast<struct device *>(dev));
uartTransport = s_transport.get();
}
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
uartTransport = new UartTransport(reinterpret_cast<struct device *>(dev));
#else
#error "Unknown eRPC allocation policy!"
#endif

transport = reinterpret_cast<erpc_transport_t>(uartTransport);

if (uartTransport != NULL)
{
if (uartTransport->init() != kErpcStatus_Success)
{
erpc_transport_zephyr_uart_deinit(transport);
transport = NULL;
}
}

return transport;
}

void erpc_transport_zephyr_uart_deinit(erpc_transport_t transport)
{
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_STATIC
(void)transport;
s_transport.destroy();
#elif ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
erpc_assert(transport != NULL);

UartTransport *uartTransport = reinterpret_cast<UartTransport *>(transport);

delete uartTransport;
#endif
}
35 changes: 34 additions & 1 deletion erpc_c/setup/erpc_transport_setup.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
* Copyright 2016-2022 NXP
* Copyright 2016-2024 NXP
* Copyright 2019 ACRIOS Systems s.r.o.
* All rights reserved.
*
Expand Down Expand Up @@ -508,6 +508,11 @@ erpc_transport_t erpc_transport_cmsis_uart_init(void *uartDrv);
*/
void erpc_transport_cmsis_uart_deinit(erpc_transport_t transport);

//@}

//! @name Zephyr transports setup
//@{

/*!
* @brief Create a Zephyr UART transport.
*
Expand All @@ -520,6 +525,34 @@ void erpc_transport_cmsis_uart_deinit(erpc_transport_t transport);
*/
erpc_transport_t erpc_transport_zephyr_uart_init(void *dev);

/*!
* @brief Deinitialize Zephyr UART transport.
*
* @param[in] transport Transport which was initialized with init function.
*/
void erpc_transport_zephyr_uart_deinit(erpc_transport_t transport);

/*!
* @brief Create a Zephyr MBOX transport.
*
* Create a Zephyr MBOX transport instance, to be used on both the server
* and the client side.
*
* @param[in] dev Zephyr MBOX device address.
* @param[in] tx_channel Zephyr MBOX transmit channel.
* @param[in] rx_channel Zephyr MBOX receive channel.
*
* @return Return NULL or erpc_transport_t instance pointer.
*/
erpc_transport_t erpc_transport_zephyr_mbox_init(void *dev, void *tx_channel, void *rx_channel);

/*!
* @brief Deinitialize Zephyr MBOX transport.
*
* @param[in] transport Transport which was initialized with init function.
*/
void erpc_transport_zephyr_mbox_deinit(erpc_transport_t transport);

//@}

//! @name USB CDC transport setup
Expand Down
Loading

0 comments on commit 5c2c6b7

Please sign in to comment.