From b3ece5a5554a242522799864ef4714513d4bcf97 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sun, 3 Mar 2019 16:40:09 +1300 Subject: Re-add debug macro, short circuit icon logic --- common.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'common.h') 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__) /* */ -#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 -- cgit v1.1