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