Skip to content

Commit

Permalink
Version 0.9.5
Browse files Browse the repository at this point in the history
- All public configurations (#defines) have moved to RemoteDebugCfg.h, to
  facilitate changes for anybody.
- Changed examples with warnings on change any #define in project,
   with workarounds, if it not work. (thanks to @22MarioZ for added this issue)
  • Loading branch information
JoaoLopesF committed Mar 19, 2019
1 parent c0eca39 commit 5ebfc74
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 44 deletions.
53 changes: 42 additions & 11 deletions examples/RemoteDebugger/RemoteDebugger.ino
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,6 @@

//#define WEB_SERVER_ENABLED true

// Disable all debug ?
//
// Important to compile for prodution/release
// Disable all debug ? Good to release builds (production)
// as nothing of RemoteDebug is compiled, zero overhead :-)
// For it just uncomment the DEBUG_DISABLED
// On change it, if in another IDE than Arduino IDE, like Eclipse or VSCODE,
// please clean the project, before compile

//#define DEBUG_DISABLED true

////// Includes

#if defined ESP8266
Expand Down Expand Up @@ -141,6 +130,48 @@ WebServer HTTPServer(80);

// Remote debug over WiFi - not recommended for production/release, only for development

// Options for RemoteDebug of this project

// Attention: read this, before you change any option
//
// If yot changed it and not works, the compiler is using catching old compiled files
// To workaround this:
// - If have a clean project option (as Eclipse/Platformio), do it
// - or force compiler to compiler all (changing any configuration of board)
// - or to this change globally in RemoteDebugCfg.h (on library directory)
// - And upload again
//
// thanks to @22MarioZ for added this issue

// Disable all debug ?
// Important to compile for prodution/release
// Disable all debug ? Good to release builds (production)
// as nothing of RemoteDebug is compiled, zero overhead :-)
// Uncomment the line below, to do it:
//#define DEBUG_DISABLED true

// Disable te auto function feature of RemoteDebug
// Good if your code already have func name on debug messages
// Uncomment the line below, to do it:
//#define DEBUG_DISABLE_AUTO_FUNC true

// Disable Websocket? This is used with RemoteDebugApp connection
// Uncomment the line below, to do it:
//#define WEBSOCKET_DISABLED true

#ifndef WEBSOCKET_DISABLED // Only if Web socket enabled (RemoteDebugApp)
// If enabled, you can change the port here (8232 is default)
// Uncomment the line below, to do it:
//#define WEBSOCKET_PORT 8232

// Internally, the RemoteDebug uses a local copy of the arduinoWebSockets library (https://github.com/Links2004/arduinoWebSockets)
// Due it not in Arduino Library Manager
// If your project already use this library,
// Uncomment the line below, to do it:
//#define USE_LIB_WEBSOCKET true
#endif


#include "RemoteDebug.h" //https://github.com/JoaoLopesF/RemoteDebug

#ifndef DEBUG_DISABLED // Only if debug is not disabled (for production/release)
Expand Down
9 changes: 8 additions & 1 deletion src/RemoteDebugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*
* Versions:
* ------ ---------- -----------------
* 0.9.5 2019-03-19 All configurations have moved to RemoteDebugCfg.h,
* Due #defines in project not working, thanks to @22MarioZ for added this issue)
* Adjusted examples to indicate modify RemoteDebugCfg.h, instead project file (not works)
* 0.9.4 2019-03-16 Adjustments on example
* 0.9.3 2019-03-13 Support to RemoteDebug with connection by web socket
* debugBreak for RemoteDebug now is redirect to a debugSilence of RemoteDebug
Expand Down Expand Up @@ -57,6 +60,10 @@
* - Error on use debug* macros with F()
*/

///// RemoteDebug configuration

#include <RemoteDebugCfg.h>

/////// Includes

// Incude for this module
Expand Down Expand Up @@ -144,7 +151,7 @@

// Version

#define DEBUGGER_VERSION "0.9.4"
#define DEBUGGER_VERSION "0.9.5"

// Low memory board ?

Expand Down
61 changes: 29 additions & 32 deletions src/RemoteDebugger.h
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
/*
* Header for RemoteDebugger
*
* Copyright (C) 2018 Joao Lopes https://github.com/JoaoLopesF/RemoteDebuggger
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
* MIT License
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
* Copyright (c) 2019 Joao Lopes https://github.com/JoaoLopesF/RemoteDebug
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* This header file describes the public API for sending debug messages to a telnet client.
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/

#ifndef REMOTEDEBUGGER_H
#define REMOTEDEBUGGER_H

///// RemoteDebug configuration

#include <RemoteDebugCfg.h>

// Debug enabled ?

#ifndef DEBUG_DISABLED

//////// Simple software debugger (based on SerialDebug)

// Is for SerialDebug (TODO: in future will some code for both library)
// Is for SerialDebug ? (TODO: in future will some code for both library)

//#define DEBUGGER_FOR_SERIALDEBUG true

// Is for RemoteDebug
// Is for RemoteDebug ?

#define DEBUGGER_FOR_REMOTEDEBUG true

Expand Down Expand Up @@ -74,10 +89,6 @@ typedef enum { // Type of operator
DEBUG_WATCH_GREAT_EQ // Greater or equal (>=)
} debugEnumWatch_t;

// Disable debug - good for release (production)
// Put below define after the include SerialDebug/RemoteDebug in your project to disable all debug
// as nothing of SerialDebug/RemoteDebug is compiled, zero overhead :-)
//#define DEBUG_DISABLED true

#ifdef DEBUG_DISABLED

Expand All @@ -91,23 +102,8 @@ typedef enum { // Type of operator

#endif

// Disable debugger ? No more commands and features as functions and globals
// Uncomment this to disable it (SerialDebug will not do reads from Serial, good if already have this)
//#define DEBUG_DISABLE_DEBUGGER true

#ifndef DEBUG_DISABLE_DEBUGGER // Debugger enabled

// Enable Flash variables support - F()
// Used internally in SerialDebug and in public API
// If is a low memory board, like AVR, all strings in SerialDebug is using flash memory
// If have RAM memory, this is more fast than flash
//#define DEBUG_USE_FLASH_F true

// For Espressif boards, default is not flash support for printf,
// due it have a lot of memory and Serial.printf is not compatible with it
// If you need more memory, can force it:
//#define DEBUG_USE_FLASH_F true

//////// Defines

// Internal printf ?
Expand Down Expand Up @@ -448,6 +444,7 @@ extern boolean _debugDebuggerEnabled; // Simple Software Debugger enabled ?

#endif // DEBUG_DISABLE_DEBUGGER

#endif // DEBUG_DISABLED
#endif // H

//////// End

0 comments on commit 5ebfc74

Please sign in to comment.