From: Hugo Villeneuve Date: Sun, 2 Jan 2022 22:36:47 +0000 (-0500) Subject: Add ACPI debug macro X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=22febab3e281cb60641ad198e8fa90ac3ed9c3ec;p=dockapps%2Fdockbatmon.git Add ACPI debug macro --- 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);