Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions erpc_c/setup/erpc_setup_mbf_static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ class StaticMessageBufferFactory : public MessageBufferFactory
* @brief Constructor.
*/
StaticMessageBufferFactory()
#if !ERPC_THREADS_IS(ERPC_THREADS_NONE)
: m_semaphore(0)
#endif
{
uint32_t i;
for (i = 0; i <= (ERPC_DEFAULT_BUFFERS_COUNT >> 3); i++)
Expand Down
9 changes: 8 additions & 1 deletion erpc_c/transports/uart_cmsis_transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*/

#include "uart_cmsis_transport.h"
#include "board.h"
#include <cstdio>

using namespace erpc;
Expand All @@ -41,6 +40,7 @@ using namespace erpc;

static volatile bool s_isTransferReceiveCompleted = false;
static volatile bool s_isTransferSendCompleted = false;
constexpr auto kStatus_Success = ARM_DRIVER_OK;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not use c++11 specific code.


////////////////////////////////////////////////////////////////////////////////
// Code
Expand Down Expand Up @@ -74,6 +74,13 @@ erpc_status_t UartTransport::init()
{
erpc_status_t status = (*m_uartDrv).Initialize(TransferCallback);
(*m_uartDrv).PowerControl(ARM_POWER_FULL);

/*Configure the USART to 9600 Bits/sec */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These settings are application specific and should be set before calling constructor of this class.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that Control configuration has any guarantee of functioning before Initialize is called it seems to me that maybe the m_uartDrv should be initialized and then passed to the constructor removing the need for init.

m_uartDrv->Control(ARM_USART_MODE_ASYNCHRONOUS | ARM_USART_DATA_BITS_8 | ARM_USART_PARITY_NONE | ARM_USART_STOP_BITS_1 | ARM_USART_FLOW_CONTROL_NONE, 9600);

/* Enable Receiver and Transmitter lines */
m_uartDrv->Control(ARM_USART_CONTROL_TX, 1);
m_uartDrv->Control(ARM_USART_CONTROL_RX, 1);

return status != kStatus_Success ? kErpcStatus_InitFailed : kErpcStatus_Success;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ARM_DRIVER_OK here instead of kStatus_Success. kStatus_Success is redundant from older times.

I would also change status variable type from erpc_status_t to int32_t as in CMSIS driver is used.

}
Expand Down
1 change: 0 additions & 1 deletion erpc_c/transports/uart_cmsis_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

#include "Driver_USART.h"
#include "framed_transport.h"
#include "fsl_common.h"
#include <stdlib.h>

/*!
Expand Down