Skip to content

Commit 12f5c80

Browse files
committed
Version 0.9.72
- Corrected bug on basic example - Few adjustments
1 parent 7676c10 commit 12f5c80

File tree

5 files changed

+37
-40
lines changed

5 files changed

+37
-40
lines changed

Examples/SerialDebug_basic/SerialDebug_basic.ino

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,8 @@
55
// Author: Joao Lopes
66
// GitHub: https://github.com/JoaoLopesF/SerialDebug
77
//
8-
// Example to show how to use it.
8+
// Basic example to show how to use it.
99
//
10-
// Example of use:
11-
//
12-
// debugA("This is a always - var %d", var);
13-
//
14-
// debugV("This is a verbose - var %d", var);
15-
// debugD("This is a debug - var %d", var);
16-
// debugI("This is a information - var %d", var);
17-
// debugW("This is a warning - var %d", var);
18-
// debugE("This is a error - var %d", var);
19-
//
20-
// debugV("This not have args");
2110
///////
2211

2312
////// Includes
@@ -89,7 +78,7 @@ void setup() {
8978

9079
// Note: all debug in setup must be debugA (always), due it is disabled now.
9180

92-
debugA(F("**** Setup: initializing ..."));
81+
printlnA(F("**** Setup: initializing ..."));
9382

9483
// Buildin led
9584

@@ -102,7 +91,7 @@ void setup() {
10291

10392
// End
10493

105-
debugA(F("*** Setup end"));
94+
printlnA(F("*** Setup end"));
10695

10796
}
10897

@@ -125,17 +114,19 @@ void loop()
125114

126115
// Debug the time (verbose level)
127116

128-
debugV(F("Time: %u seconds (VERBOSE)"), mTimeSeconds);
117+
printV(F("Time: "));
118+
printV(mTimeSeconds);
119+
printlnV(F(" seconds (VERBOSE)"));
129120

130121
if (mTimeSeconds % 5 == 0) { // Each 5 seconds
131122

132123
// Debug levels
133124

134-
debugV(F("This is a message of debug level VERBOSE"));
135-
debugD(F("This is a message of debug level DEBUG"));
136-
debugI(F("This is a message of debug level INFO"));
137-
debugW(F("This is a message of debug level WARNING"));
138-
debugE(F("This is a message of debug level ERROR"));
125+
printlnV(F("This is a message of debug level VERBOSE"));
126+
printlnD(F("This is a message of debug level DEBUG"));
127+
printlnI(F("This is a message of debug level INFO"));
128+
printlnW(F("This is a message of debug level WARNING"));
129+
printlnE(F("This is a message of debug level ERROR"));
139130

140131
// Functions example to show auto function name feature
141132

@@ -160,24 +151,16 @@ void foo() {
160151

161152
uint8_t var = 1;
162153

163-
debugV(F("This is a debug - var %u"), var);
154+
printV(F("This is a debug - var "));
155+
printlnV(var);
164156
}
165157

166158
void bar() {
167159

168160
uint8_t var = 2;
169161

170-
debugD(F("This is a debug - var %u"), var);
171-
172-
// Example of float formatting:
173-
174-
float val = 1.23f;
175-
176-
#ifndef ARDUINO_ARCH_AVR // Native float printf support
177-
debugV("float = %.3f", val);
178-
#else // For AVR, it is not supported, using String instead
179-
debugV("float = %s", String(val).c_str());
180-
#endif
162+
printD(F("This is a debug - var "));
163+
printlnD(var);
181164

182165
}
183166

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SerialDebug Library for Arduino
22

3-
<a href="#releases">![build badge](https://img.shields.io/badge/version-v0.9.71-blue.svg)</a> [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5ddb5c53fa29416eb1d1eaaf6f201ec6)](https://app.codacy.com/app/JoaoLopesF/SerialDebug?utm_source=github.com&utm_medium=referral&utm_content=JoaoLopesF/SerialDebug&utm_campaign=Badge_Grade_Settings)
3+
<a href="#releases">![build badge](https://img.shields.io/badge/version-v0.9.72-blue.svg)</a> [![Codacy Badge](https://api.codacy.com/project/badge/Grade/5ddb5c53fa29416eb1d1eaaf6f201ec6)](https://app.codacy.com/app/JoaoLopesF/SerialDebug?utm_source=github.com&utm_medium=referral&utm_content=JoaoLopesF/SerialDebug&utm_campaign=Badge_Grade_Settings)
44
<a href="https://github.com/JoaoLopesF/SerialDebug/blob/master/LICENSE.txt">![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)</a>
55
[![Gitter chat](https://badges.gitter.im/SerialDebug/gitter.png)](https://gitter.im/SerialDebug/Public)
66

@@ -20,6 +20,7 @@ or call a function, in runtime, using serial monitor.
2020
- [Install](#install)
2121
- [Usage](#usage)
2222
- [Watches](#watches)
23+
- [Khow issues](#khow-issues)
2324
- [Releases](#releases)
2425
- [Links](#links)
2526
- [Thanks](#thanks)
@@ -759,8 +760,16 @@ How this works, without a real hardware debugger? :
759760

760761
This is done before each _debug*_ show messages or in _debugHandle_ function.
761762

763+
## Khow issues
764+
765+
- Error on use debug* macros with F(). workaround for now: print* macros is ok for it.
766+
762767
## Releases
763768

769+
### 0.9.72 - 2018-10-21
770+
771+
- Corrected bug on basic example
772+
764773
### 0.9.71 - 2018-10-19
765774

766775
- Just for new release, due problems on library.proprierties

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "git",
88
"url": "https://github.com/JoaoLopesF/SerialDebug.git"
99
},
10-
"version": "0.9.71",
10+
"version": "0.9.72",
1111
"frameworks": "arduino",
1212
"platforms": "*"
1313
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SerialDebug
2-
version=0.9.71
2+
version=0.9.72
33
author=Joao Lopes
44
maintainer=Joao Lopes
55
sentence=Improved serial debug to Arduino with debug levels an simple software debugger

src/SerialDebug.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
* Note: This lybrary not use tasks, when for ESP32, due avoid serial output mixed
88
* Versions :
99
* ------ ---------- -------------------------
10+
* 0.9.72 2018-10-21 Corrected bug on basic example
11+
* Few adjustments
1012
* 0.9.71 2018-10-19 Just for new release, due problems on library.proprierties
1113
* 0.9.7 2018-10-18 Checking if debugger is enabled
1214
* 0.9.6 2018-10-09 New debug format output
@@ -49,6 +51,11 @@
4951
* - gpio commands
5052
*/
5153

54+
/*
55+
* TODO known issues:
56+
* - Error on use debug* macros with F()
57+
*/
58+
5259
// Disable debug - good for release (production)
5360
// Put below define after the include SerialDebug in your project to disable all debug
5461
// as nothing of SerialDebug is compiled, zero overhead :-)
@@ -110,7 +117,7 @@
110117

111118
// Version
112119

113-
#define DEBUG_VERSION F("0.9.71") // Version of this library
120+
#define DEBUG_VERSION F("0.9.72") // Version of this library
114121

115122
// Low memory board ?
116123

@@ -892,8 +899,6 @@ void debugPrintInfo(const char level, const char* function) {
892899
Serial.print(millis());
893900
}
894901

895-
Serial.print(' ');
896-
897902
_debugLastTime = millis();
898903

899904
// Show function
@@ -902,8 +907,8 @@ void debugPrintInfo(const char level, const char* function) {
902907

903908
if (function) { // Auto function
904909

905-
Serial.print(function);
906910
Serial.print(' ');
911+
Serial.print(function);
907912

908913
}
909914
#endif
@@ -912,9 +917,9 @@ void debugPrintInfo(const char level, const char* function) {
912917

913918
#ifdef DEBUG_CORE
914919

920+
Serial.print(' ');
915921
Serial.print('C');
916922
Serial.print(xPortGetCoreID());
917-
Serial.print(' ');
918923

919924
#endif
920925

0 commit comments

Comments
 (0)