Skip to content

Commit fa8cfdf

Browse files
Merge branch 'main' into develop
# Conflicts: # erpc_c/infra/erpc_message_buffer.cpp # erpc_c/port/erpc_threading_freertos.cpp # erpc_c/port/erpc_threading_zephyr.cpp # erpc_c/setup/erpc_setup_rpmsg_tty_rtos_remote.cpp # erpc_c/setup/erpc_transport_setup.h # erpc_c/transports/erpc_rpmsg_lite_rtos_transport.cpp # erpc_c/transports/erpc_rpmsg_lite_transport.cpp # erpcgen/src/Generator.cpp # erpcgen/src/SymbolScanner.cpp # erpcgen/src/erpcgen.cpp # test/common/unit_test_tcp_arbitrator_client.cpp
2 parents 685c527 + 85d3dd8 commit fa8cfdf

File tree

256 files changed

+17475
-172
lines changed

Some content is hidden

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

256 files changed

+17475
-172
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-2023 NXP
2+
Copyright 2016-2024 NXP
33
All rights reserved.
44

55
The BSD 3 Clause License

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,4 +251,4 @@ Repository on Github contains two main branches: __main__ and __develop__. Code
251251
---
252252
Copyright 2014-2016 Freescale Semiconductor, Inc.
253253

254-
Copyright 2016-2023 NXP
254+
Copyright 2016-2024 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.11.0"
41+
PROJECT_NUMBER = "Rev. 1.12.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.11.0"
41+
PROJECT_NUMBER = "Rev. 1.12.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_message_buffer.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2021 NXP
3+
* Copyright 2016-2023 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -110,13 +110,17 @@ void MessageBuffer::swap(MessageBuffer *other)
110110

111111
void Cursor::setBuffer(MessageBuffer &buffer, uint8_t reserved)
112112
{
113-
erpc_assert(buffer != NULL);
114-
115-
m_buffer = buffer;
116113
// RPMSG when nested calls are enabled can set NULL buffer.
117114
// erpc_assert(buffer->get() && "Data buffer wasn't set to MessageBuffer.");
118115
// receive function should return err if it couldn't set data buffer.
119-
m_pos = buffer.get() + reserved;
116+
117+
// erpc_assert(buffer != NULL);
118+
119+
m_buffer = buffer;
120+
if (buffer != NULL)
121+
{
122+
m_pos = buffer.get() + reserved;
123+
}
120124
}
121125

122126
MessageBuffer Cursor::getBuffer(void)

erpc_c/infra/erpc_version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
////////////////////////////////////////////////////////////////////////////////
2121

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

2727
/*! @} */
2828

erpc_c/port/erpc_port_zephyr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 NXP
2+
* Copyright 2017-2023 NXP
33
* Copyright 2021 ACRIOS Systems s.r.o.
44
* All rights reserved.
55
*
@@ -12,7 +12,7 @@
1212
#include <new>
1313

1414
extern "C" {
15-
#include "kernel.h"
15+
#include <zephyr/kernel.h>
1616
};
1717

1818
using namespace std;

erpc_c/port/erpc_threading.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc.
3-
* Copyright 2016-2021 NXP
3+
* Copyright 2016-2023 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -25,7 +25,7 @@
2525
#include "semphr.h"
2626
#include "task.h"
2727
#elif ERPC_THREADS_IS(ZEPHYR)
28-
#include "kernel.h"
28+
#include <zephyr/kernel.h>
2929
#elif ERPC_THREADS_IS(MBED)
3030
#if MBED_CONF_RTOS_PRESENT
3131
#include "rtos.h"
@@ -99,7 +99,7 @@ class Thread
9999
* @param[in] stackPtr Mandatory task stack pointer for static api usage.
100100
*/
101101
Thread(thread_entry_t entry, uint32_t priority = 0, uint32_t stackSize = 0, const char *name = 0,
102-
thread_stack_pointer stackPtr = 0);
102+
thread_stack_pointer stackPtr = NULL);
103103

104104
/*!
105105
* @brief Destructor.
@@ -128,7 +128,7 @@ class Thread
128128
* @param[in] stackSize Stack size.
129129
* @param[in] stackPtr Mandatory task stack pointer for static api usage.
130130
*/
131-
void init(thread_entry_t entry, uint32_t priority = 0, uint32_t stackSize = 0, thread_stack_pointer stackPtr = 0);
131+
void init(thread_entry_t entry, uint32_t priority = 0, uint32_t stackSize = 0, thread_stack_pointer stackPtr = NULL);
132132

133133
/*!
134134
* @brief This function starts thread execution.
@@ -156,7 +156,7 @@ class Thread
156156
#elif ERPC_THREADS_IS(FREERTOS)
157157
return reinterpret_cast<thread_id_t>(m_task);
158158
#elif ERPC_THREADS_IS(ZEPHYR)
159-
return reinterpret_cast<thread_id_t>(m_thread);
159+
return reinterpret_cast<thread_id_t>(m_thread_id);
160160
#elif ERPC_THREADS_IS(MBED)
161161
return reinterpret_cast<thread_id_t>(m_thread->get_id());
162162
#elif ERPC_THREADS_IS(WIN32)
@@ -238,7 +238,8 @@ class Thread
238238
StaticTask_t m_staticTask; /*!< Hold static task data. */
239239
#endif
240240
#elif ERPC_THREADS_IS(ZEPHYR)
241-
struct k_thread m_thread; /*!< Current thread. */
241+
struct k_thread m_thread; /*!< Current thread. */
242+
k_tid_t m_thread_id;
242243
k_thread_stack_t *m_stack; /*!< Pointer to stack. */
243244
#elif ERPC_THREADS_IS(MBED)
244245
rtos::Thread *m_thread; /*!< Underlying Thread instance */
@@ -282,7 +283,7 @@ class Thread
282283
* @param[in] arg2
283284
* @param[in] arg3
284285
*/
285-
static void *threadEntryPointStub(void *arg1, void *arg2, void *arg3);
286+
static void threadEntryPointStub(void *arg1, void *arg2, void *arg3);
286287

287288
#elif ERPC_THREADS_IS(MBED)
288289

erpc_c/port/erpc_threading_freertos.cpp

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-2021 NXP
3+
* Copyright 2016-2023 NXP
44
* Copyright 2021 ACRIOS Systems s.r.o.
55
* All rights reserved.
66
*
@@ -27,14 +27,14 @@ Thread *Thread::s_first = NULL;
2727
////////////////////////////////////////////////////////////////////////////////
2828

2929
Thread::Thread(const char *name) :
30-
m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_task(0), m_next(0)
30+
m_name(name), m_entry(NULL), m_arg(0), m_stackSize(0), m_priority(0), m_stackPtr(NULL), m_task(0), m_next(0)
3131
{
3232
}
3333

3434
Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name,
3535
thread_stack_pointer stackPtr) :
3636
m_name(name),
37-
m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_task(0), m_next(0)
37+
m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_stackPtr(stackPtr), m_task(0), m_next(0)
3838
{
3939
}
4040

erpc_c/port/erpc_threading_zephyr.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2021 NXP
2+
* Copyright 2017-2023 NXP
33
* Copyright 2021 ACRIOS Systems s.r.o.
44
* All rights reserved.
55
*
@@ -18,14 +18,14 @@ using namespace erpc;
1818
////////////////////////////////////////////////////////////////////////////////
1919

2020
Thread::Thread(const char *name) :
21-
m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(0), m_stack(0)
21+
m_name(name), m_entry(0), m_arg(0), m_stackSize(0), m_priority(0), m_thread(), m_stack(0)
2222
{
2323
}
2424

2525
Thread::Thread(thread_entry_t entry, uint32_t priority, uint32_t stackSize, const char *name,
2626
thread_stack_pointer stackPtr) :
2727
m_name(name),
28-
m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(0), m_stack(0)
28+
m_entry(entry), m_arg(0), m_stackSize(stackSize), m_priority(priority), m_thread(), m_stack(0)
2929
{
3030
}
3131

@@ -44,12 +44,13 @@ void Thread::start(void *arg)
4444
m_arg = arg;
4545

4646
erpc_assert((m_stack != NULL) && ("Set stack address" != NULL));
47-
k_thread_create(&m_thread, m_stack, m_stackSize, threadEntryPointStub, this, NULL, NULL, m_priority, 0, K_NO_WAIT);
47+
m_thread_id = k_thread_create(&m_thread, m_stack, m_stackSize, threadEntryPointStub, this, NULL, NULL, m_priority,
48+
0, K_NO_WAIT);
4849
}
4950

5051
bool Thread::operator==(Thread &o)
5152
{
52-
return m_thread == o.m_thread;
53+
return &m_thread == &o.m_thread;
5354
}
5455

5556
Thread *Thread::getCurrentThread(void)
@@ -59,7 +60,7 @@ Thread *Thread::getCurrentThread(void)
5960

6061
void Thread::sleep(uint32_t usecs)
6162
{
62-
k_sleep(usecs / 1000);
63+
k_sleep(K_USEC(usecs));
6364
}
6465

6566
void Thread::threadEntryPoint(void)
@@ -70,7 +71,7 @@ void Thread::threadEntryPoint(void)
7071
}
7172
}
7273

73-
void *Thread::threadEntryPointStub(void *arg1, void *arg2, void *arg3)
74+
void Thread::threadEntryPointStub(void *arg1, void *arg2, void *arg3)
7475
{
7576
Thread *_this = reinterpret_cast<Thread *>(arg1);
7677
erpc_assert((_this != NULL) && ("Reinterpreting 'void *arg1' to 'Thread *' failed." != NULL));
@@ -81,7 +82,7 @@ void *Thread::threadEntryPointStub(void *arg1, void *arg2, void *arg3)
8182
k_thread_abort(k_current_get());
8283
}
8384

84-
Mutex::Mutex(void) : m_mutex(0)
85+
Mutex::Mutex(void) : m_mutex()
8586
{
8687
k_mutex_init(&m_mutex);
8788
}
@@ -104,7 +105,7 @@ bool Mutex::unlock(void)
104105
return true;
105106
}
106107

107-
Semaphore::Semaphore(int count) : m_sem(0)
108+
Semaphore::Semaphore(int count) : m_sem()
108109
{
109110
// Set max count to highest signed int.
110111
k_sem_init(&m_sem, count, 0x7fffffff);
@@ -131,12 +132,12 @@ bool Semaphore::get(uint32_t timeoutUsecs)
131132
}
132133
}
133134

134-
return (k_sem_take(&m_sem, timeoutUsecs) == 0);
135+
return (k_sem_take(&m_sem, K_USEC(timeoutUsecs)) == 0);
135136
}
136137

137138
int Semaphore::getCount(void) const
138139
{
139-
return k_sem_count_get(m_sem);
140+
return k_sem_count_get(const_cast<k_sem *>(&m_sem));
140141
}
141142
#endif /* ERPC_THREADS_IS(ZEPHYR) */
142143

0 commit comments

Comments
 (0)