Skip to content

Commit 8df6a67

Browse files
committed
simplify definition of SUB_MSG_COUNT and move to mros2 repo
1 parent e393545 commit 8df6a67

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

include/mros2_user_config.h renamed to include/mros2_config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
extern "C" {
66
#endif
77

8-
extern int mros2_get_submsg_count(void);
8+
#define SUB_MSG_COUNT 10
99

1010
#ifdef __cplusplus
1111
}

src/mros2.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#include "mros2.h"
2-
#include "mros2_user_config.h"
32

43
#include <rtps/rtps.h>
54

65
#ifdef __MBED__
76
#include "mbed.h"
87
#else /* __MBED__ */
8+
#include "mros2_config.h"
99
#include "cmsis_os.h"
1010
#endif /* __MBED__ */
1111

@@ -90,8 +90,7 @@ void mros2_init(void *args)
9090
domain_ptr = &domain;
9191

9292
#ifndef __MBED__
93-
int sub_msg_count = mros2_get_submsg_count();
94-
subscriber_msg_queue_id = osMessageQueueNew(sub_msg_count, SUB_MSG_SIZE, NULL);
93+
subscriber_msg_queue_id = osMessageQueueNew(SUB_MSG_COUNT, SUB_MSG_SIZE, NULL);
9594
if (subscriber_msg_queue_id == NULL) {
9695
MROS2_ERROR("[MROS2LIB] ERROR: mROS2 init failed");
9796
return;

0 commit comments

Comments
 (0)