/* GPDriver source debug.h */

/* not the nicest style to include definitions via a header file, but
   this is only the debugging infrastructure, so it is not essential */

#if DEBUG
#define REPORT(a) report(a);
#define REPORT_D(a,b) report_d(a,b);
#define REPORT_C(a,b) report_c(a,b);
static void report(const char* msg)
{
  char cmd[256];
  strcpy(cmd, "Report ");
  strcat(cmd, msg);
  xos_cli(cmd);
}

static void report_d(const char* tmsg, int n)
{
  char msg[256];
  sprintf(msg,tmsg,n);
  report(msg);
}

static void report_c(const char* tmsg, const char* s)
{
  char msg[256];
  sprintf(msg,tmsg,s);
  report(msg);
}
#else
#define REPORT(a)
#define REPORT_D(a,b)
#define REPORT_C(a,b)
#endif
