From f9cf6742a20fb385ee1198ff37f11691beb868b7 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 16 Nov 2019 17:12:31 +0100 Subject: [PATCH] rename SERIAL to DSERIAL usage: add this in main .ino before any header inclusion #define DSERIAL Serial1 --- Debug.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Debug.h b/Debug.h index 2306cc52..a7d0f872 100644 --- a/Debug.h +++ b/Debug.h @@ -32,42 +32,42 @@ // can be used to move the debug output to Serial1 (useful on STM32 BluePill) // must be defined in main .ino before any eader inclusion! -#ifndef SERIAL - #define SERIAL Serial +#ifndef DSERIAL + #define DSERIAL Serial #endif template - inline void DPRINT(T str) { SERIAL.print(str); } + inline void DPRINT(T str) { DSERIAL.print(str); } template inline void DPRINTLN(T str) { DPRINT(str); DPRINT(F("\n")); } inline void DHEX(uint8_t b) { - if( b<0x10 ) SERIAL.print('0'); - SERIAL.print(b,HEX); + if( b<0x10 ) DSERIAL.print('0'); + DSERIAL.print(b,HEX); } inline void DHEX(uint16_t b) { - if( b<0x10 ) SERIAL.print(F("000")); - else if( b<0x100 ) SERIAL.print(F("00")); - else if( b<0x1000 ) SERIAL.print(F("0")); - SERIAL.print(b,HEX); + if( b<0x10 ) DSERIAL.print(F("000")); + else if( b<0x100 ) DSERIAL.print(F("00")); + else if( b<0x1000 ) DSERIAL.print(F("0")); + DSERIAL.print(b,HEX); } inline void DHEX(uint32_t b) { - if( b<0x10 ) SERIAL.print(F("0000000")); - else if( b<0x100 ) SERIAL.print(F("000000")); - else if( b<0x1000 ) SERIAL.print(F("00000")); - else if( b<0x10000 ) SERIAL.print(F("0000")); - else if( b<0x100000 ) SERIAL.print(F("000")); - else if( b<0x1000000 ) SERIAL.print(F("00")); - else if( b<0x10000000 ) SERIAL.print(F("0")); - SERIAL.print(b,HEX); + if( b<0x10 ) DSERIAL.print(F("0000000")); + else if( b<0x100 ) DSERIAL.print(F("000000")); + else if( b<0x1000 ) DSERIAL.print(F("00000")); + else if( b<0x10000 ) DSERIAL.print(F("0000")); + else if( b<0x100000 ) DSERIAL.print(F("000")); + else if( b<0x1000000 ) DSERIAL.print(F("00")); + else if( b<0x10000000 ) DSERIAL.print(F("0")); + DSERIAL.print(b,HEX); } template inline void DDEC(TYPE b) { - SERIAL.print(b,DEC); + DSERIAL.print(b,DEC); } #define DINIT(baudrate,msg) \ - SERIAL.begin(baudrate); \ + DSERIAL.begin(baudrate); \ DPRINTLN(msg); #define DDEVINFO(dev) \