summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2023-07-15 21:38:12 +0200
committerLoic Guegan <manzerbredes@mailbox.org>2023-07-15 21:38:12 +0200
commitfe62b113653199d0678024b5126a17166b6bf5b0 (patch)
treec5168382070b6a06d755e5e3dc3fe531dedf2c96 /src/utils.h
parent8f6bf2c440444b3dbb900fd5a8319cacfa0f3730 (diff)
Minor changes
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/utils.h b/src/utils.h
index 4fd6b68..d427d01 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -8,25 +8,24 @@
#define MIN_INTERVAL 30
#define INA260_SYSFS "/sys/kernel/ina260"
#define INA260_POWER_REGISTER "registers/power"
+
#ifndef ZMQ_TOKEN
#define ZMQ_TOKEN "ina260-zmq-publisher"
#endif
+
+#ifndef ZMQ_MSG_SIZE
#define ZMQ_MSG_SIZE 255*10
+#endif
#define STR(symbol) #symbol
#define STRINGIFY(symbol) STR(symbol)
-
#define TIMESTAMP() (time(NULL))
-
#define INTERVAL(duration)\
((TIMESTAMP()) - ((TIMESTAMP())%(duration)))
-
#define INTERVAL_NEXT(duration)\
((INTERVAL(duration))+(duration))
-
#define INTERVAL_LAST(duration)\
(INTERVAL(INTERVAL((TIMESTAMP()),(duration))-1,(duration)))
-
#define FILE_EXISTS(path) (access((path), F_OK) == 0)
void mkdirp(char *path); \ No newline at end of file