#ifndef MAD_CORE_COMMON_H
#define MAD_CORE_COMMON_H

#include "common/types.h"
#include "common/watchdog.h"

#include <stddef.h>
#include <stdarg.h>

#define UNUSED(s)         (void)(s)
#define BIT(n)            (0x1U << (n))
#define MAX(a, b)         ((a) > (b) ? (a) : (b))
#define MIN(a, b)         ((a) < (b) ? (a) : (b))
#define CLAMP(n, hi, lo)  (MIN((hi), MAX((n), (lo))))

void Info(const char *fmt, ...);
void Error(const char *fmt, ...);

#include <util/delay.h>
#define Sleep(ms) _delay_ms(ms)

#endif // MAD_CORE_COMMON_H
