From a814b8b65b6e03220e5aab14b41a354ffba16fea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Oct 2022 12:09:23 +0000 Subject: [PATCH 1/8] Bump geekyeggo/delete-artifact from 1 to 2 Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 1 to 2. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v1...v2) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 986bda6..10abaea 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -114,7 +114,7 @@ jobs: path: ${{ env.CONFIGURATIONS_FOLDER }} - name: Remove unneeded artifact - uses: geekyeggo/delete-artifact@v1 + uses: geekyeggo/delete-artifact@v2 with: name: ${{ env.CONFIGURATIONS_ARTIFACT }} From 086b772e68fff1d5e1a18655322331b5bda1e709 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 17 Oct 2022 13:33:08 +0200 Subject: [PATCH 2/8] Ignore .vscode folder. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..687f872 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.vscode/ + From da94c6b85906036e61f1ae94d4c1a7b188a6ff13 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 17 Oct 2022 13:35:44 +0200 Subject: [PATCH 3/8] Use debug macros instead of using the longform access via instantiated object. --- .../Arduino_Debug_Advance.ino | 2 +- .../Arduino_Debug_Basic.ino | 2 +- src/Arduino_DebugUtils.h | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino b/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino index 5837b52..2138601 100644 --- a/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino +++ b/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino @@ -24,7 +24,7 @@ void setup() { int i = 0; void loop() { - Debug.print(DBG_VERBOSE, "i = %d", i); + DBG_VERBOSE("i = %d", i); i++; delay(1000); } diff --git a/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino b/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino index ddfedfe..03f0446 100644 --- a/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino +++ b/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino @@ -8,7 +8,7 @@ void setup() { int i = 0; void loop() { - Debug.print(DBG_INFO, "i = %d", i); + DBG_INFO("i = %d", i); i++; delay(1000); } diff --git a/src/Arduino_DebugUtils.h b/src/Arduino_DebugUtils.h index 335f1c5..635c72e 100644 --- a/src/Arduino_DebugUtils.h +++ b/src/Arduino_DebugUtils.h @@ -93,4 +93,28 @@ class Arduino_DebugUtils { extern Arduino_DebugUtils Debug; +/************************************************************************************** + * DEFINE + **************************************************************************************/ + +#ifndef DBG_ERROR +# define DBG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) +#endif + +#ifndef DBG_WARNING +# define DBG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__) +#endif + +#ifndef DBG_INFO +# define DBG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__) +#endif + +#ifndef DBG_DEBUG +# define DBG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__) +#endif + +#ifndef DBG_VERBOSE +# define DBG_VERBOSE(fmt, ...) Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__) +#endif + #endif /* ARDUINO_DEBUG_UTILS_H_ */ From 53f1679bbeedbd0322d1251959ab292233a5a67c Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 17 Oct 2022 13:43:24 +0200 Subject: [PATCH 4/8] Rename DBG_* to DEBUG_* to avoid a conflict with the similiarly defined constants. --- .../Arduino_Debug_Advance.ino | 2 +- .../Arduino_Debug_Basic.ino | 2 +- src/Arduino_DebugUtils.h | 20 +++++++++---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino b/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino index 2138601..dbc704c 100644 --- a/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino +++ b/examples/Arduino_Debug_Advance/Arduino_Debug_Advance.ino @@ -24,7 +24,7 @@ void setup() { int i = 0; void loop() { - DBG_VERBOSE("i = %d", i); + DEBUG_VERBOSE("i = %d", i); i++; delay(1000); } diff --git a/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino b/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino index 03f0446..1806e90 100644 --- a/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino +++ b/examples/Arduino_Debug_Basic/Arduino_Debug_Basic.ino @@ -8,7 +8,7 @@ void setup() { int i = 0; void loop() { - DBG_INFO("i = %d", i); + DEBUG_INFO("i = %d", i); i++; delay(1000); } diff --git a/src/Arduino_DebugUtils.h b/src/Arduino_DebugUtils.h index 635c72e..73e6287 100644 --- a/src/Arduino_DebugUtils.h +++ b/src/Arduino_DebugUtils.h @@ -97,24 +97,24 @@ extern Arduino_DebugUtils Debug; * DEFINE **************************************************************************************/ -#ifndef DBG_ERROR -# define DBG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) +#ifndef DEBUG_ERROR +# define DEBUG_ERROR(fmt, ...) Debug.print(DBG_ERROR, fmt, ## __VA_ARGS__) #endif -#ifndef DBG_WARNING -# define DBG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__) +#ifndef DEBUG_WARNING +# define DEBUG_WARNING(fmt, ...) Debug.print(DBG_WARNING, fmt, ## __VA_ARGS__) #endif -#ifndef DBG_INFO -# define DBG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__) +#ifndef DEBUG_INFO +# define DEBUG_INFO(fmt, ...) Debug.print(DBG_INFO, fmt, ## __VA_ARGS__) #endif -#ifndef DBG_DEBUG -# define DBG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__) +#ifndef DEBUG_DEBUG +# define DEBUG_DEBUG(fmt, ...) Debug.print(DBG_DEBUG, fmt, ## __VA_ARGS__) #endif -#ifndef DBG_VERBOSE -# define DBG_VERBOSE(fmt, ...) Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__) +#ifndef DEBUG_VERBOSE +# define DEBUG_VERBOSE(fmt, ...) Debug.print(DBG_VERBOSE, fmt, ## __VA_ARGS__) #endif #endif /* ARDUINO_DEBUG_UTILS_H_ */ From 3e93e8d403a02a1a5a29c8296e4dc9e17c04f45d Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 17 Oct 2022 13:46:21 +0200 Subject: [PATCH 5/8] Update README showing macro usage. --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index bd8dcd6..23ea200 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Example: ```C++ int i = 1; float pi = 3.1459; -Debug.print(DBG_VERBOSE, "i = %d, pi = %f", i, pi); +DEBUG_VERBOSE("i = %d, pi = %f", i, pi); ``` **Note**: The output of floating point numbers (`%f`) does NOT work on [ArduinoCore-avr](https://github.com/arduino/ArduinoCore-avr). @@ -43,7 +43,7 @@ Parameter debug_level in order of lowest to highest priority are : `DBG_NONE`, ` Return type: void. Example: -``` +```C++ Debug.setDebugLevel(DBG_VERBOSE); ``` ### Debug.setDebugOutputStream(Stream * stream) : @@ -52,7 +52,7 @@ By default, Output Stream is Serial. In advanced cases other objects could be ot Return type: void. Example: -``` +```C++ SoftwareSerial mySerial(10, 11); // RX, TX Debug.setDebugOutputStream(&mySerial); ``` @@ -63,9 +63,9 @@ By default, printing timestamp is off, unless turned on using this function call Return type: void. Example: -``` +```C++ Debug.timestampOn(); -Debug.print(DBG_VERBOSE, "i = %d", i); //Output looks like : [ 21007 ] i = 21 +DBG_VERBOSE("i = %d", i); //Output looks like : [ 21007 ] i = 21 ``` ### Debug.timestampOff() : @@ -74,9 +74,9 @@ Calling this function switches off the timestamp in the `Debug.print()` function Return type: void. Example: -``` +```C++ Debug.timestampOff(); -Debug.print(DBG_VERBOSE, "i = %d", i); //Output looks like : i = 21 +DEBUG_VERBOSE("i = %d", i); //Output looks like : i = 21 ``` ### Debug.newlineOn() : @@ -85,7 +85,7 @@ By default, a newline is sent Return type: void. Example: -``` +```C++ Debug.newlineOn(); ``` @@ -95,7 +95,7 @@ By default a newline is sent. Call this to shut that functionality off. Return type: void. Example: -``` +```C++ Debug.timestampOff(); ``` @@ -106,8 +106,8 @@ This function prints the message if parameter `debug_level` in the `Debug.print( Return type: void. Example: -``` +```C++ Debug.setDebugLevel(DBG_VERBOSE); int i = 0; -Debug.print(DBG_VERBOSE, "DBG_VERBOSE i = %d", i); +DEBUG_VERBOSE("DBG_VERBOSE i = %d", i); ``` From 7b468684ab2d4c2d3f8d6a771ec6fd2978a6e417 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 17 Oct 2022 13:47:33 +0200 Subject: [PATCH 6/8] List DEBUG_* macros for correct syntax highlighting. --- keywords.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keywords.txt b/keywords.txt index e5c2020..d175771 100644 --- a/keywords.txt +++ b/keywords.txt @@ -17,6 +17,11 @@ setDebugOutputStream KEYWORD2 timestampOn KEYWORD2 timestampOff KEYWORD2 print KEYWORD2 +DEBUG_ERROR KEYWORD2 +DEBUG_WARNING KEYWORD2 +DEBUG_INFO KEYWORD2 +DEBUG_DEBUG KEYWORD2 +DEBUG_VERBOSE KEYWORD2 ####################################### # Constants (LITERAL1) From 3d14d821f7f9cb42d3876abf5bebee9d9adcb35b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 12:09:25 +0000 Subject: [PATCH 7/8] Bump carlosperate/download-file-action from 1 to 2 Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1 to 2. - [Release notes](https://github.com/carlosperate/download-file-action/releases) - [Commits](https://github.com/carlosperate/download-file-action/compare/v1...v2) --- updated-dependencies: - dependency-name: carlosperate/download-file-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/sync-labels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync-labels.yml b/.github/workflows/sync-labels.yml index 10abaea..94938f3 100644 --- a/.github/workflows/sync-labels.yml +++ b/.github/workflows/sync-labels.yml @@ -31,7 +31,7 @@ jobs: - name: Download JSON schema for labels configuration file id: download-schema - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json location: ${{ runner.temp }}/label-configuration-schema @@ -65,7 +65,7 @@ jobs: steps: - name: Download - uses: carlosperate/download-file-action@v1 + uses: carlosperate/download-file-action@v2 with: file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} From af1530c7da403998b96ee90b83532ff3a50dafd3 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 2 Nov 2022 09:23:12 +0100 Subject: [PATCH 8/8] Release v1.4.0. --- library.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.properties b/library.properties index c1099ca..b59e2da 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Arduino_DebugUtils -version=1.3.0 +version=1.4.0 author=Arduino maintainer=Arduino sentence=Debugging module with different debug levels, timestamps and printf-style output. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy