Using Serial for debug

This commit is contained in:
Pascal Langer 2017-11-26 20:58:36 +01:00
parent 84d7986353
commit 5cb2326ea7
2 changed files with 3 additions and 3 deletions

View File

@ -333,7 +333,7 @@ enum FailSafeMode {
//Status messages //Status messages
#if defined(STM32_BOARD) && defined (SERIAL_DEBUG) #if defined(STM32_BOARD) && defined (SERIAL_DEBUG)
#define debug(msg, ...) {char buf[64]; sprintf(buf, msg "\r\n", ##__VA_ARGS__); Serial1.write(buf);} #define debug(msg, ...) {char buf[64]; sprintf(buf, msg "\r\n", ##__VA_ARGS__); Serial.write(buf);}
#else #else
#define debug(...) #define debug(...)
#undef SERIAL_DEBUG #undef SERIAL_DEBUG

View File

@ -23,7 +23,7 @@
#include <avr/pgmspace.h> #include <avr/pgmspace.h>
//#define DEBUG_TX //#define DEBUG_TX
//#define SERIAL_DEBUG // Only for STM32_BOARD on usart1 //#define SERIAL_DEBUG // Only for STM32_BOARD compiled with Serial mode usart1, compiled with STM32 bootloader USB serial
#define USE_MY_CONFIG #define USE_MY_CONFIG
@ -207,7 +207,7 @@ void setup()
{ {
// Setup diagnostic uart before anything else // Setup diagnostic uart before anything else
#ifdef SERIAL_DEBUG #ifdef SERIAL_DEBUG
Serial1.begin(115200,SERIAL_8N1); Serial.begin(115200,SERIAL_8N1);
debug("Multiprotocol version: %d.%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_PATCH_LEVEL); debug("Multiprotocol version: %d.%d.%d.%d", VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_PATCH_LEVEL);
#endif #endif