-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e1a55b
commit cfa48f2
Showing
94 changed files
with
46,647 additions
and
274 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
106 changes: 106 additions & 0 deletions
106
example/multicore_examples/erpc_common/erpc_error_handler.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
/* | ||
* Copyright (c) 2016, Freescale Semiconductor, Inc. | ||
* Copyright 2016-2020 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#include "erpc_error_handler.h" | ||
#include "fsl_debug_console.h" | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Variables | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
bool g_erpc_error_occurred = false; | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// Code | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
void erpc_error_handler(erpc_status_t err, uint32_t functionID) | ||
{ | ||
if (err == (erpc_status_t)kErpcStatus_Success) | ||
{ | ||
return; | ||
} | ||
|
||
switch (err) | ||
{ | ||
case (erpc_status_t)kErpcStatus_Fail: | ||
(void)PRINTF("\r\nGeneric failure."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_InvalidArgument: | ||
(void)PRINTF("\r\nArgument is an invalid value."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_Timeout: | ||
(void)PRINTF("\r\nOperated timed out."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_InvalidMessageVersion: | ||
(void)PRINTF("\r\nMessage header contains an unknown version."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_ExpectedReply: | ||
(void)PRINTF("\r\nExpected a reply message but got another message type."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_CrcCheckFailed: | ||
(void)PRINTF("\r\nMessage is corrupted."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_BufferOverrun: | ||
(void)PRINTF("\r\nAttempt to read or write past the end of a buffer."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_UnknownName: | ||
(void)PRINTF("\r\nCould not find host with given name."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_ConnectionFailure: | ||
(void)PRINTF("\r\nFailed to connect to host."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_ConnectionClosed: | ||
(void)PRINTF("\r\nConnected closed by peer."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_MemoryError: | ||
(void)PRINTF("\r\nMemory allocation error."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_ServerIsDown: | ||
(void)PRINTF("\r\nServer is stopped."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_InitFailed: | ||
(void)PRINTF("\r\nTransport layer initialization failed."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_ReceiveFailed: | ||
(void)PRINTF("\r\nFailed to receive data."); | ||
break; | ||
|
||
case (erpc_status_t)kErpcStatus_SendFailed: | ||
(void)PRINTF("\r\nFailed to send data."); | ||
break; | ||
|
||
/* unhandled error */ | ||
default: | ||
(void)PRINTF("\r\nUnhandled error occurred."); | ||
break; | ||
} | ||
|
||
/* When error occurred on client side. */ | ||
if (functionID != 0U) | ||
{ | ||
(void)PRINTF("Function id '%u'.", (unsigned int)functionID); | ||
} | ||
(void)PRINTF("\r\n"); | ||
|
||
/* error occurred */ | ||
g_erpc_error_occurred = true; | ||
} |
47 changes: 47 additions & 0 deletions
47
example/multicore_examples/erpc_common/erpc_error_handler.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Copyright (c) 2016, Freescale Semiconductor, Inc. | ||
* Copyright 2016-2022 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
#ifndef _EMBEDDED_RPC__ERROR_HANDLER_H_ | ||
#define _EMBEDDED_RPC__ERROR_HANDLER_H_ | ||
|
||
#include "erpc_common.h" | ||
#include <stdint.h> | ||
|
||
/*! | ||
* @addtogroup error_handler | ||
* @{ | ||
* @file | ||
*/ | ||
|
||
//////////////////////////////////////////////////////////////////////////////// | ||
// API | ||
//////////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
//! @name Error handler | ||
//@{ | ||
|
||
/*! | ||
* @brief This function handles eRPC errors. | ||
* | ||
* This function prints a description of occurred error and sets bool variable g_erpc_error_occurred which is used for | ||
* determining if error occurred in user application on client side. | ||
*/ | ||
void erpc_error_handler(erpc_status_t err, uint32_t functionID); | ||
|
||
//@} | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/*! @} */ | ||
#endif // _EMBEDDED_RPC__ERROR_HANDLER_H_ |
58 changes: 58 additions & 0 deletions
58
...icore_examples/erpc_common/erpc_matrix_multiply/service/c_erpc_matrix_multiply_client.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc. | ||
* Copyright 2016 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* Generated by erpcgen 1.12.0 on Wed Oct 25 10:00:57 2023. | ||
* | ||
* AUTOGENERATED - DO NOT EDIT | ||
*/ | ||
|
||
|
||
#include "c_erpc_matrix_multiply_client.h" | ||
#include "erpc_matrix_multiply_client.hpp" | ||
#include "erpc_manually_constructed.hpp" | ||
|
||
using namespace erpc; | ||
using namespace std; | ||
using namespace erpcShim; | ||
|
||
|
||
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC | ||
MatrixMultiplyService_client *s_MatrixMultiplyService_client = nullptr; | ||
#else | ||
ERPC_MANUALLY_CONSTRUCTED_STATIC(MatrixMultiplyService_client, s_MatrixMultiplyService_client); | ||
#endif | ||
|
||
void erpcMatrixMultiply(Matrix matrix1, Matrix matrix2, Matrix result_matrix) | ||
{ | ||
s_MatrixMultiplyService_client->erpcMatrixMultiply(matrix1, matrix2, result_matrix); | ||
} | ||
|
||
void initMatrixMultiplyService_client(erpc_client_t client) | ||
{ | ||
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC | ||
erpc_assert(s_MatrixMultiplyService_client == nullptr); | ||
s_MatrixMultiplyService_client = new MatrixMultiplyService_client(reinterpret_cast<ClientManager *>(client)); | ||
#else | ||
erpc_assert(!s_MatrixMultiplyService_client.isUsed()); | ||
s_MatrixMultiplyService_client.construct(reinterpret_cast<ClientManager *>(client)); | ||
#endif | ||
} | ||
|
||
void deinitMatrixMultiplyService_client(void) | ||
{ | ||
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC | ||
if (s_MatrixMultiplyService_client != nullptr) | ||
{ | ||
delete s_MatrixMultiplyService_client; | ||
s_MatrixMultiplyService_client = nullptr; | ||
} | ||
#else | ||
s_MatrixMultiplyService_client.destroy(); | ||
#endif | ||
} |
53 changes: 53 additions & 0 deletions
53
...lticore_examples/erpc_common/erpc_matrix_multiply/service/c_erpc_matrix_multiply_client.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc. | ||
* Copyright 2016 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* Generated by erpcgen 1.12.0 on Wed Oct 25 10:00:57 2023. | ||
* | ||
* AUTOGENERATED - DO NOT EDIT | ||
*/ | ||
|
||
|
||
#if !defined(_c_erpc_matrix_multiply_client_h_) | ||
#define _c_erpc_matrix_multiply_client_h_ | ||
|
||
#include "erpc_matrix_multiply_common.h" | ||
#include "erpc_client_manager.h" | ||
|
||
#if defined(__cplusplus) | ||
extern "C" | ||
{ | ||
#endif | ||
|
||
#if !defined(ERPC_FUNCTIONS_DEFINITIONS) | ||
#define ERPC_FUNCTIONS_DEFINITIONS | ||
|
||
|
||
/*! @brief MatrixMultiplyService identifiers */ | ||
enum _MatrixMultiplyService_ids | ||
{ | ||
kMatrixMultiplyService_service_id = 1, | ||
kMatrixMultiplyService_erpcMatrixMultiply_id = 1, | ||
}; | ||
|
||
//! @name MatrixMultiplyService | ||
//@{ | ||
void erpcMatrixMultiply(Matrix matrix1, Matrix matrix2, Matrix result_matrix); | ||
//@} | ||
|
||
#endif // ERPC_FUNCTIONS_DEFINITIONS | ||
|
||
void initMatrixMultiplyService_client(erpc_client_t client); | ||
|
||
void deinitMatrixMultiplyService_client(void); | ||
|
||
#if defined(__cplusplus) | ||
} | ||
#endif | ||
|
||
#endif // _c_erpc_matrix_multiply_client_h_ |
78 changes: 78 additions & 0 deletions
78
...icore_examples/erpc_common/erpc_matrix_multiply/service/c_erpc_matrix_multiply_server.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright (c) 2014-2016, Freescale Semiconductor, Inc. | ||
* Copyright 2016 NXP | ||
* All rights reserved. | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
|
||
/* | ||
* Generated by erpcgen 1.12.0 on Wed Oct 25 10:00:57 2023. | ||
* | ||
* AUTOGENERATED - DO NOT EDIT | ||
*/ | ||
|
||
|
||
#include <new> | ||
#include "c_erpc_matrix_multiply_server.h" | ||
#include "erpc_matrix_multiply_server.hpp" | ||
#include "erpc_manually_constructed.hpp" | ||
|
||
using namespace erpc; | ||
using namespace std; | ||
using namespace erpcShim; | ||
|
||
|
||
class MatrixMultiplyService_server: public MatrixMultiplyService_interface | ||
{ | ||
public: | ||
virtual ~MatrixMultiplyService_server() {}; | ||
|
||
|
||
void erpcMatrixMultiply(Matrix matrix1, Matrix matrix2, Matrix result_matrix) | ||
{ | ||
::erpcMatrixMultiply(matrix1, matrix2, result_matrix); | ||
} | ||
}; | ||
|
||
ERPC_MANUALLY_CONSTRUCTED_STATIC(MatrixMultiplyService_service, s_MatrixMultiplyService_service); | ||
ERPC_MANUALLY_CONSTRUCTED_STATIC(MatrixMultiplyService_server, s_MatrixMultiplyService_server); | ||
|
||
erpc_service_t create_MatrixMultiplyService_service(void) | ||
{ | ||
erpc_service_t service; | ||
|
||
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC | ||
service = new (nothrow) MatrixMultiplyService_service(new (nothrow)MatrixMultiplyService_server()); | ||
#else | ||
if (s_MatrixMultiplyService_service.isUsed()) | ||
{ | ||
service = NULL; | ||
} | ||
else | ||
{ | ||
s_MatrixMultiplyService_server.construct(); | ||
s_MatrixMultiplyService_service.construct(s_MatrixMultiplyService_server.get()); | ||
service = s_MatrixMultiplyService_service.get(); | ||
} | ||
#endif | ||
|
||
return service; | ||
} | ||
|
||
void destroy_MatrixMultiplyService_service(erpc_service_t service) | ||
{ | ||
#if ERPC_ALLOCATION_POLICY == ERPC_ALLOCATION_POLICY_DYNAMIC | ||
if (service) | ||
{ | ||
delete (MatrixMultiplyService_server *)(((MatrixMultiplyService_service *)service)->getHandler()); | ||
delete (MatrixMultiplyService_service *)service; | ||
} | ||
#else | ||
(void)service; | ||
erpc_assert(service == s_MatrixMultiplyService_service.get()); | ||
s_MatrixMultiplyService_service.destroy(); | ||
s_MatrixMultiplyService_server.destroy(); | ||
#endif | ||
} | ||
|
Oops, something went wrong.