logging/nxscope: allow use in C++ code

allow nxscope to use in C++ code

Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
raiden00pl 2024-08-09 10:52:42 +02:00 committed by Xiang Xiao
parent fb6b3ddfd9
commit 71df58e937
4 changed files with 52 additions and 0 deletions

View file

@ -53,6 +53,14 @@
* Public Types
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* Nxscope header ID */
enum nxscope_hdr_id_e
@ -488,4 +496,9 @@ int nxscope_recv(FAR struct nxscope_s *s);
int nxscope_stream_start(FAR struct nxscope_s *s, bool start);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_H */

View file

@ -37,6 +37,14 @@
* Public Types
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* Nxscope sample type */
enum nxscope_sample_dtype_e
@ -400,4 +408,9 @@ int nxscope_put_ub32(FAR struct nxscope_s *s, uint8_t ch, ub32_t val);
int nxscope_put_b32(FAR struct nxscope_s *s, uint8_t ch, b32_t val);
int nxscope_put_char(FAR struct nxscope_s *s, uint8_t ch, char val);
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_CHAN_H */

View file

@ -37,6 +37,14 @@
* Public Types
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* Forward declaration */
struct nxscope_intf_s;
@ -125,4 +133,9 @@ int nxscope_ser_init(FAR struct nxscope_intf_s *intf,
void nxscope_ser_deinit(FAR struct nxscope_intf_s *intf);
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_INTF_H */

View file

@ -33,6 +33,14 @@
* Public Types
****************************************************************************/
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/* Nxscope frame handler */
struct nxscope_frame_s
@ -104,4 +112,9 @@ int nxscope_proto_ser_init(FAR struct nxscope_proto_s *proto, FAR void *cfg);
void nxscope_proto_ser_deinit(FAR struct nxscope_proto_s *proto);
#endif
#undef EXTERN
#ifdef __cplusplus
}
#endif
#endif /* __APPS_INCLUDE_LOGGING_NXSCOPE_NXSCOPE_PROTO_H */