aboutsummaryrefslogtreecommitdiff
path: root/common.h
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2019-03-03 16:40:09 +1300
committerDavid Phillips <david@sighup.nz>2019-03-03 16:40:09 +1300
commitb3ece5a5554a242522799864ef4714513d4bcf97 (patch)
tree985c0f38e0566637eaa07f1fb010fb6da142d5d9 /common.h
parent179b04f1d6c46d27747dfb857dbaec6ed8342ca2 (diff)
downloadparamano-b3ece5a5554a242522799864ef4714513d4bcf97.tar.xz
Re-add debug macro, short circuit icon logic
Diffstat (limited to 'common.h')
-rw-r--r--common.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/common.h b/common.h
index ff8c8a8..6b2e92d 100644
--- a/common.h
+++ b/common.h
@@ -12,5 +12,17 @@ int get_int(const char* string);
#define STR_LINE STRING(__LINE__)
/* </ew> */
-#define info(...) printf("INFO: "__FILE__":"STR_LINE" --- "__VA_ARGS__)
+#define info(format, ...) printf("INFO : "__FILE__"@%s():"STR_LINE": "format, __func__ __VA_OPT__(,) __VA_ARGS__)
+
+#ifdef DEBUG
+#define debug(format, ...) fprintf(stderr, "DEBUG: "__FILE__"@%s():"STR_LINE": "format, __func__ __VA_OPT__(,) __VA_ARGS__)
+#else
+#define debug(...)
+#endif
+
+#define debug_entry() debug("entry\n")
+#define debug_exit() debug("exit\n")
+
#define FILE_PATH_SIZE 2048
+#define CPU_TRAY_UPDATE_INTERVAL 2000
+#define BAT_TRAY_UPDATE_INTERVAL 10000