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

@@ -50,11 +50,13 @@ static void can_rx_handler(const struct device *dev, struct can_frame *frame, vo
ring_buf_put(&in_ringbuf, msg->data, MIN(ring_buf_space_get(&in_ringbuf), msg->len));
/*
printf("RX: ");
for (size_t i = 0; i < msg->len; i++) {
printf("%02X ", msg->data[i]);
}
printf(" / %i\n", msg->len);
*/
}
bool zephyr_transport_open(struct uxrCustomTransport * transport){
@@ -112,11 +114,13 @@ size_t zephyr_transport_write(struct uxrCustomTransport* transport, const uint8_
can_send(params->uart_dev, &frame, K_NO_WAIT, NULL, NULL);
/*
printf("TX: ");
for (size_t i = 0; i < len; i++) {
printf("%02X ", msg->data[i]);
}
printf(" / %i\n", msg->len);
*/
return len;
}

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);
}
*/
}