Home | History | Annotate | Download | only in Linux_x86
      1 
      2 
      3 
      4 /*-----------------------------------------------------------------------------------
      5                                    DEBUG CORNER
      6 ------------------------------------------------------------------------------------*/
      7 #ifdef DAL_TRACE
      8 #include <stdio.h>
      9 
     10 #define MAX_TRACE_BUFFER    150
     11 
     12 #define DAL_PRINT( str )  phOsalNfc_DbgString(str)
     13 #define DAL_DEBUG(str, arg)     \
     14 {                                       \
     15     char        trace[MAX_TRACE_BUFFER];                    \
     16     snprintf(trace,MAX_TRACE_BUFFER,str,arg);   \
     17     phOsalNfc_DbgString(trace);                 \
     18 }
     19 
     20 #define DAL_PRINT_BUFFER(msg,buf,len)       \
     21 {                                       \
     22     uint16_t    i = 0;                  \
     23     char        trace[MAX_TRACE_BUFFER];                    \
     24     snprintf(trace,MAX_TRACE_BUFFER,"\n\t %s:",msg);    \
     25     phOsalNfc_DbgString(trace);                 \
     26     phOsalNfc_DbgTrace(buf,len);            \
     27     phOsalNfc_DbgString("\r");              \
     28 }
     29 
     30 #define DAL_ASSERT_STR(x, str)   { if (!(x)) { phOsalNfc_DbgString(str); while(1); } }
     31 
     32 #else
     33 #define DAL_PRINT( str )
     34 #define DAL_DEBUG(str, arg)
     35 #define DAL_PRINT_BUFFER(msg,buf,len)
     36 #define DAL_ASSERT_STR(x, str)
     37 
     38 #endif
     39 
     40