Adapted to LoRa Semtech + Nucleo

Dependents:   LoRaWAN-lmic-app LoRaWAN-lmic-app LoRaWAN-test-10secs LoRaPersonalizedDeviceForEverynet ... more

Fork of cantcoap by Ashley Mills

dbg.h

Committer:
pnysten
Date:
2015-11-20
Revision:
2:d0d57af6c9df

File content as of revision 2:d0d57af6c9df:

#pragma once
#include <stdio.h>

#define DEBUG 1
#undef DEBUG

#define DBG_NEWLINE "\n"

#define INFO(...) printf(__VA_ARGS__); printf(DBG_NEWLINE);
#define INFOX(...); printf(__VA_ARGS__);
#define ERR(...) printf(__VA_ARGS__); printf(DBG_NEWLINE);

#ifdef DEBUG
    #define DBG(...) fprintf(stderr,"%s:%d ",__FILE__,__LINE__); fprintf(stderr,__VA_ARGS__); fprintf(stderr,"\r\n");
    #define DBGX(...) fprintf(stderr,__VA_ARGS__);
    #define DBGLX(...) fprintf(stderr,"%s:%d ",__FILE__,__LINE__); fprintf(stderr,__VA_ARGS__);
    #define DBG_PDU() printBin();
#else
    #define DBG(...) {};
    #define DBGX(...) {};
    #define DBGLX(...) {};
    #define DBG_PDU() {};
#endif