From 22febab3e281cb60641ad198e8fa90ac3ed9c3ec Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 2 Jan 2022 17:36:47 -0500 Subject: [PATCH] Add ACPI debug macro --- src/batmon.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/batmon.c b/src/batmon.c index 203bc07..05095c8 100644 --- a/src/batmon.c +++ b/src/batmon.c @@ -65,6 +65,8 @@ #define FONT_NAME "Sans Condensed Bold" #define FONT_SIZE 9 +/* #define DEBUG_ACPI 1 */ + static int font_size; static int capacity; static int ac_online = false; @@ -95,7 +97,9 @@ static void read_ac_status(void) break; } +#ifdef DEBUG_ACPI printf("ac online = %d\n", ac_online); +#endif /* DEBUG_ACPI */ } fclose(ac_file); @@ -119,13 +123,12 @@ static void read_battery_status(void) fgets(batt_file_line, 40, batt_file); sscanf(batt_file_line, "%d", &capacity); -#ifdef _DEBUG_ - printf("DEBUG: Found capacity: %d.\n", capacity); -#endif break; } +#ifdef DEBUG_ACPI printf("capacity = %d%%\n", capacity); +#endif /* DEBUG_ACPI */ } fclose(batt_file); -- 2.20.1