#pragma once #include #include #include #include #define MIN_INTERVAL 30 #define INA260_SYSFS "/sys/kernel/ina260" #define INA260_POWER_REGISTER "registers/power" #define STR(symbol) #symbol #define STRINGIFY(symbol) STR(symbol) #define INTERVAL(timestamp,duration)\ ((timestamp) - ((timestamp)%(duration))) #define INTERVAL_LAST(timestamp,duration)\ (INTERVAL(INTERVAL((timestamp),(duration))-1,(duration))) #define TIMESTAMP() (time(NULL)) #define FILE_EXISTS(path) (access((path), F_OK) == 0) void mkdirp(char *path);