Merge pull request #7084 from AriParkkila/cellular-debug

Cellular: Enable AT debug also when mbed-trace is disabled
pull/7151/head
Cruz Monrreal 2018-06-11 09:06:53 -05:00 committed by GitHub
commit 1b14351e28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -1086,15 +1086,17 @@ void ATHandler::flush()
void ATHandler::debug_print(char *p, int len) void ATHandler::debug_print(char *p, int len)
{ {
#if MBED_CONF_MBED_TRACE_ENABLE #if MBED_CONF_CELLULAR_DEBUG_AT
if (_debug_on) { if (_debug_on) {
#if MBED_CONF_MBED_TRACE_ENABLE
mbed_cellular_trace::mutex_wait(); mbed_cellular_trace::mutex_wait();
#endif
for (ssize_t i = 0; i < len; i++) { for (ssize_t i = 0; i < len; i++) {
char c = *p++; char c = *p++;
if (!isprint(c)) { if (!isprint(c)) {
if (c == '\r') { if (c == '\r') {
debug("\n");
} else if (c == '\n') { } else if (c == '\n') {
debug("%c", c);
} else { } else {
debug("[%d]", c); debug("[%d]", c);
} }
@ -1102,7 +1104,9 @@ void ATHandler::debug_print(char *p, int len)
debug("%c", c); debug("%c", c);
} }
} }
#if MBED_CONF_MBED_TRACE_ENABLE
mbed_cellular_trace::mutex_release(); mbed_cellular_trace::mutex_release();
}
#endif #endif
}
#endif // MBED_CONF_CELLULAR_DEBUG_AT
} }