Skip to content

Commit 56393df

Browse files
eRPC updates 01/2022
-- Allow used LIBUSBSIO device index being specified from the Python command line argument. -- Remove obsolete python test files. -- Minor Misra and typo corrections. -- Update license file.
1 parent 99675ec commit 56393df

File tree

87 files changed

+723
-426
lines changed

Some content is hidden

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

87 files changed

+723
-426
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright 2014-2016 Freescale Semiconductor, Inc.
2-
Copyright 2016-2021 NXP
2+
Copyright 2016-2022 NXP
33
All rights reserved.
44

55
The BSD 3 Clause License

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,10 @@ eRPC code is validated with respect to the C++ 11 standard.
189189

190190
### Installing for Python
191191

192-
To install the Python infrastructure for eRPC, first change to the `erpc_python/` directory. Then run the setup.py script like this:
192+
To install the Python infrastructure for eRPC see instructions in the [erpc_python folder readme](erpc_python/readme.md).
193193

194-
python setup.py install
195-
196-
After installation, the `erpc` package is available via normal import statements. See the [erpc_python folder readme](erpc_python/readme.md) for more.
194+
## Known issues and limitations
195+
- Static allocations controlled by the ERPC_ALLOCATION_POLICY config macro are not fully supported yet, i.e. not all erpc objects can be allocated statically now. It deals with the ongoing process and the full static allocations support will be added in the future.
197196

198197
## Code providing
199198

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.1"
41+
PROJECT_NUMBER = "Rev. 1.9.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

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.1"
41+
PROJECT_NUMBER = "Rev. 1.9.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/config/erpc_config.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,17 @@
6666
//! Set ERPC_ALLOCATION_POLICY_DYNAMIC if dynamic allocations should be used.
6767
//! Set ERPC_ALLOCATION_POLICY_STATIC if static allocations should be used.
6868
//!
69-
//! Default value is ERPC_ALLOCATION_POLICY_DYNAMIC or in case of FreeRTOS it can be auto-detected if __has_include() is supported
70-
//! by compiler. Uncomment comment bellow to use static allocation policy.
71-
//! In case of static implementation user need consider another values to set (ERPC_CODEC_COUNT,
72-
//! ERPC_MESSAGE_LOGGERS_COUNT, ERPC_CLIENTS_THREADS_AMOUNT).
69+
//! Default value is ERPC_ALLOCATION_POLICY_DYNAMIC or in case of FreeRTOS it can be auto-detected if __has_include() is
70+
//! supported by compiler. Uncomment comment bellow to use static allocation policy. In case of static implementation
71+
//! user need consider another values to set (ERPC_CODEC_COUNT, ERPC_MESSAGE_LOGGERS_COUNT,
72+
//! ERPC_CLIENTS_THREADS_AMOUNT).
7373
// #define ERPC_ALLOCATION_POLICY (ERPC_ALLOCATION_POLICY_STATIC)
7474

7575
//! @def ERPC_CODEC_COUNT
7676
//!
7777
//! @brief Set amount of codecs objects used simultaneously in case of ERPC_ALLOCATION_POLICY is set to
78-
//! ERPC_ALLOCATION_POLICY_STATIC. For example if client or server is used in one thread then 1. If both are used in one thread per
79-
//! each then 2, ... Default value 2.
78+
//! ERPC_ALLOCATION_POLICY_STATIC. For example if client or server is used in one thread then 1. If both are used in one
79+
//! thread per each then 2, ... Default value 2.
8080
// #define ERPC_CODEC_COUNT (2U)
8181

8282
//! @def ERPC_MESSAGE_LOGGERS_COUNT
@@ -90,8 +90,8 @@
9090

9191
//! @def ERPC_CLIENTS_THREADS_AMOUNT
9292
//!
93-
//! @brief Set amount of client threads objects used in case of ERPC_ALLOCATION_POLICY is set to ERPC_ALLOCATION_POLICY_STATIC.
94-
//! Default value 1 (Most of current cases).
93+
//! @brief Set amount of client threads objects used in case of ERPC_ALLOCATION_POLICY is set to
94+
//! ERPC_ALLOCATION_POLICY_STATIC. Default value 1 (Most of current cases).
9595
// #define ERPC_CLIENTS_THREADS_AMOUNT (1U)
9696

9797
//! @def ERPC_THREADS

erpc_c/infra/erpc_arbitrated_client_manager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010

1111
#include "erpc_arbitrated_client_manager.h"
12-
1312
#include "erpc_transport_arbitrator.h"
1413

1514
#include "assert.h"

erpc_c/infra/erpc_basic_codec.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2021 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -9,7 +9,6 @@
99
*/
1010

1111
#include "erpc_basic_codec.h"
12-
1312
#include "erpc_manually_constructed.h"
1413

1514
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC
@@ -23,11 +22,11 @@ using namespace erpc;
2322
// Code
2423
////////////////////////////////////////////////////////////////////////////////
2524

26-
const uint8_t BasicCodec::kBasicCodecVersion = 1;
25+
const uint32_t BasicCodec::kBasicCodecVersion = 1UL;
2726

2827
void BasicCodec::startWriteMessage(message_type_t type, uint32_t service, uint32_t request, uint32_t sequence)
2928
{
30-
uint32_t header = (kBasicCodecVersion << 24) | ((service & 0xff) << 16) | ((request & 0xff) << 8) | (type & 0xff);
29+
uint32_t header = (kBasicCodecVersion << 24u) | ((service & 0xffu) << 16u) | ((request & 0xffu) << 8u) | ((uint32_t)type & 0xffu);
3130

3231
write(header);
3332

@@ -36,7 +35,7 @@ void BasicCodec::startWriteMessage(message_type_t type, uint32_t service, uint32
3635

3736
void BasicCodec::writeData(const void *value, uint32_t length)
3837
{
39-
if (!m_status)
38+
if (isStatusOk())
4039
{
4140
if (value != NULL)
4241
{
@@ -52,7 +51,7 @@ void BasicCodec::writeData(const void *value, uint32_t length)
5251
void BasicCodec::write(bool value)
5352
{
5453
// Make sure the bool is a single byte.
55-
uint8_t v = value;
54+
uint8_t v = (uint8_t)value;
5655

5756
writeData(&v, sizeof(v));
5857
}
@@ -109,7 +108,7 @@ void BasicCodec::write(double value)
109108

110109
void BasicCodec::writePtr(uintptr_t value)
111110
{
112-
uint8_t ptrSize = sizeof(value);
111+
uint8_t ptrSize = (uint8_t)sizeof(value);
113112

114113
write(ptrSize);
115114

@@ -189,7 +188,7 @@ void BasicCodec::startReadMessage(message_type_t *type, uint32_t *service, uint3
189188
updateStatus(kErpcStatus_InvalidMessageVersion);
190189
}
191190

192-
if (!m_status)
191+
if (isStatusOk())
193192
{
194193
*service = ((header >> 16) & 0xffU);
195194
*request = ((header >> 8) & 0xffU);
@@ -201,7 +200,7 @@ void BasicCodec::startReadMessage(message_type_t *type, uint32_t *service, uint3
201200

202201
void BasicCodec::readData(void *value, uint32_t length)
203202
{
204-
if (!m_status)
203+
if (isStatusOk())
205204
{
206205
if (value != NULL)
207206
{
@@ -219,9 +218,9 @@ void BasicCodec::read(bool *value)
219218
uint8_t v = 0;
220219

221220
readData(&v, sizeof(v));
222-
if (!m_status)
221+
if (isStatusOk())
223222
{
224-
*value = v;
223+
*value = (bool)v;
225224
}
226225
}
227226

@@ -299,15 +298,15 @@ void BasicCodec::readBinary(uint32_t *length, uint8_t **value)
299298
// Read length first as u32.
300299
read(length);
301300

302-
if (!m_status)
301+
if (isStatusOk())
303302
{
304303
if (m_cursor.getRemaining() >= *length)
305304
{
306305
// Return current pointer into buffer.
307306
*value = m_cursor.get();
308307

309308
// Skip over data.
310-
m_cursor += *length;
309+
m_cursor += (uint16_t)*length;
311310
}
312311
else
313312
{
@@ -378,7 +377,7 @@ void BasicCodec::readCallback(funPtr callbacks1, funPtr *callback2)
378377

379378
ERPC_MANUALLY_CONSTRUCTED_ARRAY_STATIC(BasicCodec, s_basicCodecManual, ERPC_CODEC_COUNT);
380379

381-
Codec *BasicCodecFactory ::create()
380+
Codec *BasicCodecFactory ::create(void)
382381
{
383382
ERPC_CREATE_NEW_OBJECT(BasicCodec, s_basicCodecManual, ERPC_CODEC_COUNT)
384383
}

erpc_c/infra/erpc_basic_codec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2021 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -41,7 +41,7 @@ enum _null_flag
4141
class BasicCodec : public Codec
4242
{
4343
public:
44-
static const uint8_t kBasicCodecVersion; /*!< Codec version. */
44+
static const uint32_t kBasicCodecVersion; /*!< Codec version. */
4545

4646
BasicCodec(void)
4747
: Codec()

erpc_c/infra/erpc_client_manager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2021 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -197,7 +197,7 @@ Codec *ClientManager::createBufferAndCodec(void)
197197
if (codec != NULL)
198198
{
199199
message = m_messageFactory->create();
200-
if (message.get())
200+
if (NULL != message.get())
201201
{
202202
codec->setBuffer(message);
203203
}

erpc_c/infra/erpc_codec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2017 NXP
3+
* Copyright 2016-2021 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -118,7 +118,7 @@ class Codec
118118
*/
119119
void updateStatus(erpc_status_t status)
120120
{
121-
if (!m_status)
121+
if (isStatusOk())
122122
{
123123
m_status = status;
124124
}

0 commit comments

Comments
 (0)