Skip to content

Commit f99e252

Browse files
eRPC updates 05/2021
-- Update erpcgen and unit tests to cover the case when enum member value is negative (Github #159 PR / #41 issue solving). -- Update (D)SPI transport layers to avoid busy loops in rtos environments, introduce semaphores. -- Introduced new transports: i2c_slave_transport (C/C++), LIBUSBSIOSPITransport (Python), LIBUSBSIOI2CTransport (Python). -- Remove const qualifier from InterThreadBufferTransport::send method parameter to align with parent Transport class (GitHub issue #172). -- Allow conditional compilation of message_loggers and pre_post_action to help to reduce the code size when compiler does not correctly strip unused code. -- Minor documentation updates. -- Version changed to 1.8.1.
1 parent a7037ad commit f99e252

31 files changed

+767
-43
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,4 @@ Repository on Github contains two main branches. __Master__ and __develop__. Cod
194194
---
195195
Copyright 2014-2016 Freescale Semiconductor, Inc.
196196

197-
Copyright 2016-2020 NXP
197+
Copyright 2016-2021 NXP

doxygen/Doxyfile.erpc

Lines changed: 1 addition & 1 deletion
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.8.0"
41+
PROJECT_NUMBER = "Rev. 1.8.1"
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

Lines changed: 1 addition & 1 deletion
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.8.0"
41+
PROJECT_NUMBER = "Rev. 1.8.1"
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_message_buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ class MessageBufferFactory
385385
virtual MessageBuffer create(void) = 0;
386386

387387
/*!
388-
* @brief This function inform server if it has to create buffer for received message.
388+
* @brief This function informs server if it has to create buffer for received message.
389389
*
390390
* @return Has to return TRUE when server need create buffer for receiving message.
391391
*/

erpc_c/infra/erpc_message_loggers.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*
2-
* Copyright 2017 NXP
2+
* Copyright 2017-2021 NXP
33
* Copyright 2021 ACRIOS Systems s.r.o.
44
* All rights reserved.
55
*
66
*
77
* SPDX-License-Identifier: BSD-3-Clause
88
*/
9+
#include "erpc_config_internal.h"
10+
#if ERPC_MESSAGE_LOGGING
911

1012
#include "erpc_message_loggers.h"
1113

@@ -82,3 +84,4 @@ erpc_status_t MessageLoggers::logMessage(MessageBuffer *msg)
8284

8385
return err;
8486
}
87+
#endif /* ERPC_MESSAGE_LOGGING */

erpc_c/infra/erpc_pre_post_action.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 NXP
2+
* Copyright 2020-2021 NXP
33
* Copyright 2020 ACRIOS Systems s.r.o.
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
@@ -8,9 +8,10 @@
88
* SPDX-License-Identifier: BSD-3-Clause
99
*/
1010

11-
#include "erpc_pre_post_action.h"
12-
1311
#include "erpc_config_internal.h"
12+
#if ERPC_PRE_POST_ACTION
13+
14+
#include "erpc_pre_post_action.h"
1415
#if ERPC_PRE_POST_ACTION_DEFAULT
1516
#include "erpc_setup_extensions.h"
1617
#endif
@@ -49,3 +50,4 @@ void PrePostAction::addPostCB(pre_post_action_cb postCB)
4950
}
5051
#endif
5152
}
53+
#endif /* ERPC_PRE_POST_ACTION */

erpc_c/infra/erpc_transport_arbitrator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class TransportArbitrator : public Transport
119119
*
120120
* @param[in] crcImpl Object containing crc-16 compute function.
121121
*/
122-
virtual void setCrc16(Crc16 *crcImpl);
122+
virtual void setCrc16(Crc16 *crcImpl) override;
123123

124124
protected:
125125
Transport *m_sharedTransport; //!< Transport being shared through this arbitrator.

erpc_c/infra/erpc_version.h

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

2222
//! @brief String version of eRPC.
23-
#define ERPC_VERSION "1.8.0"
23+
#define ERPC_VERSION "1.8.1"
2424
//! @brief Integer version of eRPC.
25-
#define ERPC_VERSION_NUMBER 10800
25+
#define ERPC_VERSION_NUMBER 10801
2626

2727
/*! @} */
2828

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright 2021 NXP
3+
* All rights reserved.
4+
*
5+
*
6+
* SPDX-License-Identifier: BSD-3-Clause
7+
*/
8+
9+
#include "erpc_i2c_slave_transport.h"
10+
#include "erpc_manually_constructed.h"
11+
#include "erpc_transport_setup.h"
12+
13+
using namespace erpc;
14+
15+
////////////////////////////////////////////////////////////////////////////////
16+
// Variables
17+
////////////////////////////////////////////////////////////////////////////////
18+
19+
static ManuallyConstructed<I2cSlaveTransport> s_transport;
20+
21+
////////////////////////////////////////////////////////////////////////////////
22+
// Code
23+
////////////////////////////////////////////////////////////////////////////////
24+
25+
erpc_transport_t erpc_transport_i2c_slave_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz)
26+
{
27+
s_transport.construct((I2C_Type *)baseAddr, baudRate, srcClock_Hz);
28+
s_transport->init();
29+
return reinterpret_cast<erpc_transport_t>(s_transport.get());
30+
}

erpc_c/setup/erpc_transport_setup.h

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2020 NXP
3+
* Copyright 2016-2021 NXP
44
* Copyright 2019 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -356,6 +356,23 @@ erpc_transport_t erpc_transport_usb_cdc_init(void *serialHandle, void *serialCon
356356
uint8_t *usbRingBuffer, uint32_t usbRingBufferLength);
357357
//@}
358358

359+
//! @name I2C transport setup
360+
//@{
361+
362+
/*!
363+
* @brief Create an I2C slave transport.
364+
*
365+
* Create I2C slave transport instance, to be used at slave core.
366+
*
367+
* @param[in] baseAddr Base address of I2C peripheral used in this transport layer.
368+
* @param[in] baudRate SPI baud rate.
369+
* @param[in] srcClock_Hz I2C source clock in Hz.
370+
*
371+
* @return Return NULL or erpc_transport_t instance pointer.
372+
*/
373+
erpc_transport_t erpc_transport_i2c_slave_init(void *baseAddr, uint32_t baudRate, uint32_t srcClock_Hz);
374+
//@}
375+
359376
//@}
360377

361378
#ifdef __cplusplus

0 commit comments

Comments
 (0)