From: Bastian Dehn Date: Fri, 16 Feb 2024 15:56:05 +0000 (+0100) Subject: add debug int and hex X-Git-Tag: v1.0.0^2~270 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=427572f5fee7e5ed4ecde92aa1c6d10284c93d3f;p=sane-kds-s2000w-net.git add debug int and hex --- diff --git a/src/kds_s2000w_debug.c b/src/kds_s2000w_debug.c index 713f82c..c94466d 100644 --- a/src/kds_s2000w_debug.c +++ b/src/kds_s2000w_debug.c @@ -6,3 +6,15 @@ void debug_printf(int level, const char* message) if (level <= LOGLEVEL) printf("%s\n", message); } + +void debug_printf_int(int level, const char* message, int value) +{ + if (level <= LOGLEVEL) + printf("%s: %i\n", message, value); +} + +void debug_printf_hex(int level, const char* message, char value) +{ + if (level <= LOGLEVEL) + printf("%s: %hhx\n", message, value); +} \ No newline at end of file diff --git a/src/kds_s2000w_debug.h b/src/kds_s2000w_debug.h index c00d677..20e0594 100644 --- a/src/kds_s2000w_debug.h +++ b/src/kds_s2000w_debug.h @@ -12,4 +12,6 @@ #define LOGLEVEL DEBUG void debug_printf(int level, const char* message); +void debug_printf_int(int level, const char* message, int value); +void debug_printf_hex(int level, const char* message, char value); #endif \ No newline at end of file