#ifndef QMSK_DEBUG_H
#define QMSK_DEBUG_H
#include <avr/io.h>
#include "stdlib.h"
#if !defined(DEBUG_DDR) || !defined(DEBUG_PIN) || !defined(DEBUG_PORT)
# error("#define DEBUG_{DDR_PIN_PORT} before #include")
#endif
static inline void debug_init (void)
{
sbi(&DEBUG_DDR, DEBUG_PIN);
}
static inline void debug_set (void)
{
sbi(&DEBUG_PORT, DEBUG_PIN);
}
static inline void debug_clear (void)
{
cbi(&DEBUG_PORT, DEBUG_PIN);
}
static inline void debug_toggle (void)
{
xbi(&DEBUG_PORT, DEBUG_PIN);
}
#endif