---------------------------------------------------------------------- Patch name: patch.cleanup-serial-logging Author: Bryce Denney Date: Wed Jun 12 20:01:22 EDT 2002 Detailed description: My previous patch added some code in Serial.h and Serial.C that you could enable at compile time by editing preprocessor symbols in Serial.h. Since then I realized that every other debug message in the program uses the Info() function call. So in this patch, I changed my #ifdef/fprintfs into Info(3, msg) calls. So if you run uisp with -v=3 or more, you can get serial logging logging at runtime, which looks like this Transmit: {V [56] } Receive: {2 [32] 3 [33] } Transmit: {v [76] } Receive: {1 [31] 0 [30] } Programmer Information: Software Version: 2.3, Hardware Version: 1.0 Patch was created with: cvs diff -u Apply patch to what version: cvs checked out on DATE, release version VER Instructions: To patch, go to main uisp directory. Type "patch -p0 < THIS_PATCH_FILE". ---------------------------------------------------------------------- Index: src/Serial.h =================================================================== RCS file: /usr/src/CVSROOT/uisp/src/Serial.h,v retrieving revision 1.6 diff -u -r1.6 Serial.h --- src/Serial.h 2002/06/12 20:03:30 1.6 +++ src/Serial.h 2002/06/12 23:56:11 @@ -43,12 +43,6 @@ #include "Global.h" #include "Error.h" -// set this to 1, if you want to log every char that goes out the serial line -#define DEBUG_LOG_TX 0 - -// set this to 1, if you want to log every char that comes in the serial line -#define DEBUG_LOG_RX 0 - class TSerial{ private: int serline; Index: src/Serial.C =================================================================== RCS file: /usr/src/CVSROOT/uisp/src/Serial.C,v retrieving revision 1.8.2.1 diff -u -r1.8.2.1 Serial.C --- src/Serial.C 2002/06/12 23:51:29 1.8.2.1 +++ src/Serial.C 2002/06/12 23:56:20 @@ -37,17 +37,16 @@ #include #include #include +#include #include "Global.h" #include "Serial.h" int TSerial::Tx(unsigned char* queue, int queue_size){ -#if DEBUG_LOG_TX - fprintf (stderr, "Transmit: {"); + Info (3, "Transmit: {"); for (int n=0; n