You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
615 B
C

#ifndef _PDEBUG_H_
#define _PDEBUG_H_
#include "atmel_start.h"
#include <stdio.h>
int pdebug_init(void);
int pprintf(const char* fmt, ...);
void passert(const bool cond, const char* msg_failure, const char* file, const int line);
int _perr(const char* str, const char* file, int line);
#ifdef DEBUG
#define assert(cond_, f_) passert(cond_, f_, __FILE__, __LINE__)
#define printf(f_, ...) pprintf((f_), ##__VA_ARGS__)
#define perr(f_) _perr(f_, __FILE__, __LINE__)
#else
#define printf(f_, ...) void(f_, ...)
#define assert(cond_, f_) void(cond_, f_)
#define perr(f_) void(f_, __FILE__, __LINE__)
#endif
#endif