feat: Populate repo

This commit is contained in:
2023-03-29 14:02:05 +02:00
commit 28bec5ebb8
168 changed files with 17860 additions and 0 deletions

25
include/macros.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef MACROS_H
#define MACROS_H
enum DEBUG_STATE { INACTIVE, ACTIVE };
// const char* PREFIX_HEARTBEAT = "[\033[31mHRTB\033[0m]\t";
// const char* PREFIX_DATABASE = "[\033[36mDTBS\033[0m]\t";
// const char* PREFIX_GPIO = "[\033[35mGPIO\033[0m]\t";
#ifndef __DEBUG__
#define __DEBUG__ ACTIVE
#endif
/** @brief Prints to the console only if DEBUG = 1 **/
#define dbg(fmt, ...) do { \
if (__DEBUG__ == ACTIVE) \
fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, __LINE__, __func__, __VA_ARGS__); \
} while (0)
#define dbg_no_info(fmt, ...) do { \
if (__DEBUG__ == ACTIVE) \
fprintf(stderr, fmt, __VA_ARGS__); \
} while (0)
#endif