[Solved] how to create a #define DEBUG in c


Use #define DEBUG when debugging and use //#define DEBUG when not…

Or you can check DEBUG == 1, like

#if defined(DEBUG) && (DEBUG == 1)
 printHex("Data received\r\n", recBuff, sizeof(recBuff)); //print out received hex data
#endif

Hope it helps…

1

solved how to create a #define DEBUG in c