summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2023-08-24 02:07:28 +0200
committercbdev <cb@cbcdn.com>2023-08-24 02:07:28 +0200
commit4067c12e4d714eca7dfe84417a3ecbb227cb85f3 (patch)
tree3d77dbb058442d9b371d7b140e217edf13132c55
parent55ba12aad7a9e368345e327f55ec5ddae4dbdb74 (diff)
downloadlibyhy-4067c12e4d714eca7dfe84417a3ecbb227cb85f3.tar.gz
libyhy-4067c12e4d714eca7dfe84417a3ecbb227cb85f3.tar.bz2
libyhy-4067c12e4d714eca7dfe84417a3ecbb227cb85f3.zip
Compile debug functions only in debug buildHEADmaster
-rw-r--r--libyhy.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libyhy.c b/libyhy.c
index 77fd89b..6ed51ac 100644
--- a/libyhy.c
+++ b/libyhy.c
@@ -9,6 +9,12 @@
#ifdef DEBUG
#include <stdio.h>
#define DBG(x) (x)
+ static void xxd(uint8_t* buf, size_t len){
+ size_t n;
+ for(n = 0; n < len; n++){
+ printf("%02X ", buf[n]);
+ }
+ }
#else
#define DBG(x)
#endif
@@ -97,13 +103,6 @@ enum /*_yhy_command*/ {
* uint8_t[4] data */
};
-static void xxd(uint8_t* buf, size_t len){
- size_t n;
- for(n = 0; n < len; n++){
- DBG(printf("%02X ", buf[n]));
- }
-}
-
static ssize_t yhy_send_command(int fd, uint16_t node, uint16_t cmd, uint8_t* payload, size_t len){
size_t n;
uint8_t checksum = 0x00;