From b262492c756304b01dba419f2fc836e2a5b83893 Mon Sep 17 00:00:00 2001 From: geeksville Date: Sat, 8 Feb 2020 10:13:04 -0800 Subject: [PATCH] show msecs required to send a packet --- src/MeshRadio.cpp | 4 +++- src/screen.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MeshRadio.cpp b/src/MeshRadio.cpp index 2758cbad..7a5e708f 100644 --- a/src/MeshRadio.cpp +++ b/src/MeshRadio.cpp @@ -95,10 +95,10 @@ ErrorCode MeshRadio::send(MeshPacket *p) ErrorCode MeshRadio::sendTo(NodeNum dest, const uint8_t *buf, size_t len) { - DEBUG_MSG("mesh sendTo %d bytes to 0x%x\n", len, dest); assert(len <= 251); // Make sure we don't overflow the tiny max packet size + uint32_t start = millis(); // Note: we don't use sendToWait here because we don't want to wait and for the time being don't require // reliable delivery // return manager.sendtoWait((uint8_t *) buf, len, dest); @@ -109,6 +109,8 @@ ErrorCode MeshRadio::sendTo(NodeNum dest, const uint8_t *buf, size_t len) if(res == ERRNO_OK) manager.waitPacketSent(); + DEBUG_MSG("mesh sendTo %d bytes to 0x%x (%u msecs)\n", len, dest, millis() - start); + return res; } diff --git a/src/screen.cpp b/src/screen.cpp index 716b7c12..0bd4d2bc 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -282,7 +282,7 @@ static void screen_print(const char *text, uint8_t x, uint8_t y, uint8_t alignme void screen_print(const char *text) { - DEBUG_MSG("Screen: %s\n", text); + DEBUG_MSG("Screen: %s", text); if (!disp) return;