reduced logging

This commit is contained in:
2025-08-31 12:25:02 +02:00
parent 8282555be6
commit fb9fb9bdf0
5 changed files with 10 additions and 4 deletions

View File

@@ -11,7 +11,7 @@ std_msgs__msg__Bool led0_msg;
void led0_callback(const void *msgin){
const std_msgs__msg__Bool *msg = (const std_msgs__msg__Bool *)msgin;
printk("Set led0 to %s\n", msg->data ? "on" : "off");
//printk("Set led0 to %s\n", msg->data ? "on" : "off");
gpio_pin_configure_dt(&led0, msg->data ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE);
}

View File

@@ -11,7 +11,7 @@ std_msgs__msg__Bool led1_msg;
void led1_callback(const void *msgin){
const std_msgs__msg__Bool *msg = (const std_msgs__msg__Bool *)msgin;
printk("Set led1 to %s\n", msg->data ? "on" : "off");
//printk("Set led1 to %s\n", msg->data ? "on" : "off");
gpio_pin_configure_dt(&led1, msg->data ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE);
}

View File

@@ -11,7 +11,7 @@ std_msgs__msg__Bool led2_msg;
void led2_callback(const void *msgin){
const std_msgs__msg__Bool *msg = (const std_msgs__msg__Bool *)msgin;
printk("Set led2 to %s\n", msg->data ? "on" : "off");
//printk("Set led2 to %s\n", msg->data ? "on" : "off");
gpio_pin_configure_dt(&led2, msg->data ? GPIO_OUTPUT_ACTIVE : GPIO_OUTPUT_INACTIVE);
}

View File

@@ -23,15 +23,17 @@ void servo_callback(const void *msgin){
uint32_t pulse_ns = min_pulse_ns + (angle / 180.0f) * (max_pulse_ns - min_pulse_ns);
printk("Set servo to %d.%d° = %d.%d ms°\n", int(angle), int(angle * 100) % 100, pulse_ns / 1000000, (pulse_ns / 1000) % 1000);
//printk("Set servo to %d.%d° = %d.%d ms°\n", int(angle), int(angle * 100) % 100, pulse_ns / 1000000, (pulse_ns / 1000) % 1000);
int ret = pwm_set_pulse_dt(&servo0, pulse_ns);
/*
if (ret == 0) {
printk("PWM pulse set successfully.\n");
} else {
printk("Failed to set PWM pulse! Error: %d\n", ret);
}
*/
}