added nrf54l15 as target
This commit is contained in:
@@ -11,15 +11,17 @@
|
||||
std_msgs__msg__Bool led_msg;
|
||||
rcl_node_t LedController::node;
|
||||
rcl_subscription_t LedController::led0_subscription;
|
||||
/*
|
||||
rcl_subscription_t LedController::led1_subscription;
|
||||
rcl_subscription_t LedController::led2_subscription;
|
||||
|
||||
*/
|
||||
|
||||
void led0_callback(const void *msg){
|
||||
gpio_pin_configure_dt(&led0, ((std_msgs__msg__Bool *)msg)->data ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void led1_callback(const void *msg){
|
||||
gpio_pin_configure_dt(&led1, ((std_msgs__msg__Bool *)msg)->data ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE);
|
||||
}
|
||||
@@ -28,7 +30,7 @@ void led1_callback(const void *msg){
|
||||
void led2_callback(const void *msg){
|
||||
gpio_pin_configure_dt(&led2, ((std_msgs__msg__Bool *)msg)->data ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
rcl_ret_t LedController::setup(rclc_support_t* support, rclc_executor_t* executor) {
|
||||
@@ -44,6 +46,7 @@ rcl_ret_t LedController::setup(rclc_support_t* support, rclc_executor_t* executo
|
||||
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Bool),
|
||||
"/nucleo/led0"));
|
||||
|
||||
/*
|
||||
RCL_RETURN_ON_ERROR(rclc_subscription_init_default(
|
||||
&LedController::led1_subscription,
|
||||
&LedController::node,
|
||||
@@ -55,6 +58,7 @@ rcl_ret_t LedController::setup(rclc_support_t* support, rclc_executor_t* executo
|
||||
&LedController::node,
|
||||
ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, Bool),
|
||||
"/nucleo/led2"));
|
||||
*/
|
||||
|
||||
RCL_RETURN_ON_ERROR(rclc_executor_add_subscription(
|
||||
executor,
|
||||
@@ -64,6 +68,7 @@ rcl_ret_t LedController::setup(rclc_support_t* support, rclc_executor_t* executo
|
||||
ON_NEW_DATA
|
||||
));
|
||||
|
||||
/*
|
||||
RCL_RETURN_ON_ERROR(rclc_executor_add_subscription(
|
||||
executor,
|
||||
&LedController::led1_subscription,
|
||||
@@ -79,6 +84,7 @@ rcl_ret_t LedController::setup(rclc_support_t* support, rclc_executor_t* executo
|
||||
led2_callback,
|
||||
ON_NEW_DATA
|
||||
));
|
||||
*/
|
||||
|
||||
return RCL_RET_OK;
|
||||
}
|
||||
@@ -86,7 +92,7 @@ rcl_ret_t LedController::setup(rclc_support_t* support, rclc_executor_t* executo
|
||||
|
||||
void LedController::kill() {
|
||||
rcl_subscription_fini(&LedController::led0_subscription, &LedController::node);
|
||||
rcl_subscription_fini(&LedController::led1_subscription, &LedController::node);
|
||||
rcl_subscription_fini(&LedController::led2_subscription, &LedController::node);
|
||||
//rcl_subscription_fini(&LedController::led1_subscription, &LedController::node);
|
||||
//rcl_subscription_fini(&LedController::led2_subscription, &LedController::node);
|
||||
rcl_node_fini(&LedController::node);
|
||||
}
|
||||
Reference in New Issue
Block a user