Skip to content

Commit 06906f1

Browse files
authored
chore: cleanup (#116)
* chore: update Docker image with `git` and `nano` * remove note-c before re-add * Squashed 'src/note-c/' content from commit e59cf1b git-subtree-dir: src/note-c git-subtree-split: e59cf1b4abb77c38464550e74071b2f4572f1e16
1 parent 404630f commit 06906f1

File tree

7 files changed

+307
-258
lines changed

7 files changed

+307
-258
lines changed

Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ RUN ["dash", "-c", "\
5757
curl \
5858
g++ \
5959
gdb \
60+
git \
6061
gzip \
6162
lcov \
63+
nano \
6264
python-is-python3 \
6365
python3 \
6466
python3-pip \

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Blues Wireless Notecard
2-
version=1.5.0
2+
version=1.5.1
33
author=Blues Wireless
44
maintainer=Blues Wireless <[email protected]>
55
sentence=An easy to use Notecard Library for Arduino.

src/note-c/n_helpers.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -2341,11 +2341,10 @@ bool NoteDebugSyncStatus(int pollFrequencyMs, int maxLevel)
23412341
J *body = JGetObject(rsp, "body");
23422342
if (body != NULL) {
23432343
if (maxLevel < 0 || JGetInt(body, "level") <= maxLevel) {
2344-
_Debug("sync: ");
2344+
_Debug("[SYNC] ");
23452345
_Debug(JGetString(body, "subsystem"));
23462346
_Debug(" ");
2347-
_Debug(JGetString(body, "text"));
2348-
_Debug("\n");
2347+
_Debugln(JGetString(body, "text"));
23492348
}
23502349
}
23512350

src/note-c/n_hooks.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ void NoteSetFnDisabled()
394394
void NoteDebugIntln(const char *line, int n)
395395
{
396396
if (line != NULL) {
397-
NoteDebug(line);
397+
_Debug(line);
398398
}
399399
char str[16];
400400
JItoA(n, str);
401-
NoteDebug(str);
402-
NoteDebug(c_newline);
401+
_Debug(str);
402+
_Debug(c_newline);
403403
}
404404

405405
//**************************************************************************/
@@ -410,8 +410,8 @@ void NoteDebugIntln(const char *line, int n)
410410
/**************************************************************************/
411411
void NoteDebugln(const char *line)
412412
{
413-
NoteDebug(line);
414-
NoteDebug(c_newline);
413+
_Debug(line);
414+
_Debug(c_newline);
415415
}
416416

417417
//**************************************************************************/
@@ -446,7 +446,7 @@ void NoteDebugWithLevel(uint8_t level, const char *msg)
446446
return;
447447
}
448448

449-
NoteDebug(msg);
449+
_Debug(msg);
450450

451451
#endif // !NOTE_NODEBUG
452452
}
@@ -461,8 +461,8 @@ void NoteDebugWithLevel(uint8_t level, const char *msg)
461461
/**************************************************************************/
462462
void NoteDebugWithLevelLn(uint8_t level, const char *msg)
463463
{
464-
NoteDebugWithLevel(level, msg);
465-
NoteDebugWithLevel(level, c_newline);
464+
_DebugWithLevel(level, msg);
465+
_DebugWithLevel(level, c_newline);
466466
}
467467

468468
//**************************************************************************/

src/note-c/n_lib.h

+14-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ extern "C" {
7979
#define CARD_RESET_DRAIN_MS 500
8080
/**************************************************************************/
8181
/*!
82-
@brief The number of times we will try to get in sync before giving up.
82+
@brief The number of times we will retry a request before giving up.
83+
*/
84+
/**************************************************************************/
85+
#define CARD_REQUEST_RETRIES_ALLOWED 5
86+
/**************************************************************************/
87+
/*!
88+
@brief The number of times we will retry getting in sync before giving up.
8389
*/
8490
/**************************************************************************/
8591
#define CARD_RESET_SYNC_RETRIES 10
@@ -127,7 +133,7 @@ bool NoteIsDebugOutputActive(void);
127133
// Utilities
128134
void n_htoa32(uint32_t n, char *p);
129135
void n_htoa16(uint16_t n, unsigned char *p);
130-
uint64_t n_atoh(char *p, int maxlen);
136+
uint64_t n_atoh(char *p, int maxLen);
131137

132138
// COBS Helpers
133139
uint32_t cobsDecode(uint8_t *ptr, uint32_t length, uint8_t eop, uint8_t *dst);
@@ -210,9 +216,15 @@ extern const char *c_badbinerr;
210216
#ifdef NOTE_NODEBUG
211217
#define _Debug(x)
212218
#define _Debugln(x)
219+
#define _DebugIntln(x, y)
220+
#define _DebugWithLevel(x, y)
221+
#define _DebugWithLevelLn(x, y)
213222
#else
214223
#define _Debug(x) NoteDebug(x)
215224
#define _Debugln(x) NoteDebugln(x)
225+
#define _DebugIntln(x, y) NoteDebugIntln(x, y)
226+
#define _DebugWithLevel(x, y) NoteDebugWithLevel(x, y)
227+
#define _DebugWithLevelLn(x, y) NoteDebugWithLevelLn(x, y)
216228
#endif
217229

218230
// End of C-callable functions

0 commit comments

Comments
 (0)