Skip to content

Commit

Permalink
Added remote logging
Browse files Browse the repository at this point in the history
Fixes for disconnects/not reconnecting. Ref #16, #24
Added SoftwareSerial library that works well without relying on external component
  • Loading branch information
jantenhove committed Apr 27, 2020
1 parent da44ff3 commit fb160aa
Show file tree
Hide file tree
Showing 21 changed files with 5,309 additions and 311 deletions.
47 changes: 47 additions & 0 deletions Debug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma once

#ifndef _DEBUG_h
#define _DEBUG_h
//DEBUG printing
#define REMOTE_DEBUGGING_ENABLED
#define DEBUGGING_ENABLED

#ifdef DEBUGGING_ENABLED

#ifdef REMOTE_DEBUGGING_ENABLED
#include <RemoteDebug.h> //https://github.com/JoaoLopesF/RemoteDebug
extern RemoteDebug Debug;

#define debugPrintf(fmt, ...) \
Debug.isRunning() ? Debug.printf( fmt, __VA_ARGS__) : Serial.printf( fmt, __VA_ARGS__)

#define debugPrint(prnt) \
Debug.isRunning() ? Debug.print(prnt) : Serial.print(prnt)

#define debugPrintBase(prnt, base) \
Debug.isRunning() ? Debug.print(prnt, base) : Serial.print(prnt, base)

#define debugPrintln(prnt) \
Debug.isRunning() ? Debug.println(prnt) : Serial.println(prnt)
#else

#define debugPrintf(fmt, ...) \
Serial.printf( fmt, __VA_ARGS__)

#define debugPrint(prnt) \
Serial.print(prnt)

#define debugPrintBase(prnt) \
Serial.print(prnt,base)

#define debugPrintln(prnt) \
Serial.println(prnt)

#endif
#else
#define debugPrintf(fmt, ...)
#define debugPrint(prnt)
#define debugPrintBase(prnt, base)
#define debugPrintln(prnt)
#endif // DEBUGGING_ENABLED
#endif
Loading

0 comments on commit fb160aa

Please sign in to comment.