Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: cleanup #116

Merged
merged 4 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ RUN ["dash", "-c", "\
curl \
g++ \
gdb \
git \
gzip \
lcov \
nano \
python-is-python3 \
python3 \
python3-pip \
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Blues Wireless Notecard
version=1.5.0
version=1.5.1
author=Blues Wireless
maintainer=Blues Wireless <[email protected]>
sentence=An easy to use Notecard Library for Arduino.
Expand Down
5 changes: 2 additions & 3 deletions src/note-c/n_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2341,11 +2341,10 @@ bool NoteDebugSyncStatus(int pollFrequencyMs, int maxLevel)
J *body = JGetObject(rsp, "body");
if (body != NULL) {
if (maxLevel < 0 || JGetInt(body, "level") <= maxLevel) {
_Debug("sync: ");
_Debug("[SYNC] ");
_Debug(JGetString(body, "subsystem"));
_Debug(" ");
_Debug(JGetString(body, "text"));
_Debug("\n");
_Debugln(JGetString(body, "text"));
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/note-c/n_hooks.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@ void NoteSetFnDisabled()
void NoteDebugIntln(const char *line, int n)
{
if (line != NULL) {
NoteDebug(line);
_Debug(line);
}
char str[16];
JItoA(n, str);
NoteDebug(str);
NoteDebug(c_newline);
_Debug(str);
_Debug(c_newline);
}

//**************************************************************************/
Expand All @@ -410,8 +410,8 @@ void NoteDebugIntln(const char *line, int n)
/**************************************************************************/
void NoteDebugln(const char *line)
{
NoteDebug(line);
NoteDebug(c_newline);
_Debug(line);
_Debug(c_newline);
}

//**************************************************************************/
Expand Down Expand Up @@ -446,7 +446,7 @@ void NoteDebugWithLevel(uint8_t level, const char *msg)
return;
}

NoteDebug(msg);
_Debug(msg);

#endif // !NOTE_NODEBUG
}
Expand All @@ -461,8 +461,8 @@ void NoteDebugWithLevel(uint8_t level, const char *msg)
/**************************************************************************/
void NoteDebugWithLevelLn(uint8_t level, const char *msg)
{
NoteDebugWithLevel(level, msg);
NoteDebugWithLevel(level, c_newline);
_DebugWithLevel(level, msg);
_DebugWithLevel(level, c_newline);
}

//**************************************************************************/
Expand Down
16 changes: 14 additions & 2 deletions src/note-c/n_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,13 @@ extern "C" {
#define CARD_RESET_DRAIN_MS 500
/**************************************************************************/
/*!
@brief The number of times we will try to get in sync before giving up.
@brief The number of times we will retry a request before giving up.
*/
/**************************************************************************/
#define CARD_REQUEST_RETRIES_ALLOWED 5
/**************************************************************************/
/*!
@brief The number of times we will retry getting in sync before giving up.
*/
/**************************************************************************/
#define CARD_RESET_SYNC_RETRIES 10
Expand Down Expand Up @@ -127,7 +133,7 @@ bool NoteIsDebugOutputActive(void);
// Utilities
void n_htoa32(uint32_t n, char *p);
void n_htoa16(uint16_t n, unsigned char *p);
uint64_t n_atoh(char *p, int maxlen);
uint64_t n_atoh(char *p, int maxLen);

// COBS Helpers
uint32_t cobsDecode(uint8_t *ptr, uint32_t length, uint8_t eop, uint8_t *dst);
Expand Down Expand Up @@ -210,9 +216,15 @@ extern const char *c_badbinerr;
#ifdef NOTE_NODEBUG
#define _Debug(x)
#define _Debugln(x)
#define _DebugIntln(x, y)
#define _DebugWithLevel(x, y)
#define _DebugWithLevelLn(x, y)
#else
#define _Debug(x) NoteDebug(x)
#define _Debugln(x) NoteDebugln(x)
#define _DebugIntln(x, y) NoteDebugIntln(x, y)
#define _DebugWithLevel(x, y) NoteDebugWithLevel(x, y)
#define _DebugWithLevelLn(x, y) NoteDebugWithLevelLn(x, y)
#endif

// End of C-callable functions
Expand Down
Loading
Loading