added nrf54l15 as target

This commit is contained in:
2025-12-18 11:42:29 +01:00
parent d02d2f24e1
commit 2cfd32abaf
13 changed files with 122 additions and 40 deletions

View File

@@ -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);
}