Add ACPI debug macro
authorHugo Villeneuve <hugo@hugovil.com>
Sun, 2 Jan 2022 22:36:47 +0000 (17:36 -0500)
committerHugo Villeneuve <hugo@hugovil.com>
Sun, 2 Jan 2022 22:43:16 +0000 (17:43 -0500)
src/batmon.c

index 203bc07..05095c8 100644 (file)
@@ -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);