Skip to content

Commit a49b313

Browse files
committed
declared variabels as extern for linker - to test
1 parent cfd63c8 commit a49b313

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

pio_workspace/lib/power_custom/power_micro_ros.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
#include "power_micro_ros.h"
22

3+
rcl_subscription_t propulsion_microseconds_subscriber;
4+
std_msgs__msg__Int16MultiArray propulsion_microseconds_msg;
5+
rclc_executor_t executor;
6+
rclc_support_t support;
7+
rcl_allocator_t allocator;
8+
rcl_node_t node;
9+
rcl_timer_t timer;
10+
311
void micro_ros_init() {
412
set_microros_transports();
513

pio_workspace/lib/power_custom/power_micro_ros.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
#define LED_PIN 13
1313

14-
rcl_subscription_t propulsion_microseconds_subscriber;
15-
std_msgs__msg__Int16MultiArray propulsion_microseconds_msg;
16-
rclc_executor_t executor;
17-
rclc_support_t support;
18-
rcl_allocator_t allocator;
19-
rcl_node_t node;
20-
rcl_timer_t timer;
14+
extern rcl_subscription_t propulsion_microseconds_subscriber;
15+
extern std_msgs__msg__Int16MultiArray propulsion_microseconds_msg;
16+
extern rclc_executor_t executor;
17+
extern rclc_support_t support;
18+
extern rcl_allocator_t allocator;
19+
extern rcl_node_t node;
20+
extern rcl_timer_t timer;
2121

2222
#define RCCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){error_loop();}}
2323
#define RCSOFTCHECK(fn) { rcl_ret_t temp_rc = fn; if((temp_rc != RCL_RET_OK)){}}

0 commit comments

Comments
 (0)