From c731273091b698233c58a9fac78c3151cf75bd28 Mon Sep 17 00:00:00 2001 From: Vincent Belpois Date: Wed, 8 May 2024 23:03:09 +0200 Subject: [PATCH] added debug messages --- src/ezbot_command_module/config/.gitignore | 0 src/ezbot_command_module/launch/.gitignore | 0 src/ezbot_command_module/src/tirette_node.cpp | 10 ++++++---- 3 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 src/ezbot_command_module/config/.gitignore create mode 100644 src/ezbot_command_module/launch/.gitignore diff --git a/src/ezbot_command_module/config/.gitignore b/src/ezbot_command_module/config/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/src/ezbot_command_module/launch/.gitignore b/src/ezbot_command_module/launch/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/src/ezbot_command_module/src/tirette_node.cpp b/src/ezbot_command_module/src/tirette_node.cpp index b654317..5caa8c6 100644 --- a/src/ezbot_command_module/src/tirette_node.cpp +++ b/src/ezbot_command_module/src/tirette_node.cpp @@ -11,22 +11,24 @@ void TiretteNode::readGPIO() int value; chip = gpiod_chip_open("/dev/gpiochip0"); + printf("chip : %p\n", chip); + if (!chip) { - // handle error + printf("unable to open GPIO\n") } line = gpiod_chip_get_line(chip, 11); if (!line) { - // handle error + printf("unable to get line\n") } if (gpiod_line_request_input(line, "tirette_node") < 0) { - // handle error + printf("unable to request line\n") } value = gpiod_line_get_value(line); if (value < 0) { - // handle error + printf("unable to get value\n") } message.data = value ? true : false;