From 23d754c85f6ef5b4dd2246b108b827b007ee4d8d Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Tue, 19 May 2020 02:48:03 +0200 Subject: [PATCH] fix max duration in LogTrace --- armsrc/BigBuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/armsrc/BigBuf.c b/armsrc/BigBuf.c index 5f1ace5f8..8ee7cc189 100644 --- a/armsrc/BigBuf.c +++ b/armsrc/BigBuf.c @@ -156,8 +156,8 @@ bool RAMFUNC LogTrace(const uint8_t *btBytes, uint16_t iLen, uint32_t timestamp_ tracing = false; // don't trace any more return false; } - if (timestamp_end - timestamp_start > UINT16_MAX) { - return false; // duration too long + if (timestamp_end - timestamp_start > 0x7FFF) { + return false; // duration too long, must be max 15 bits } hdr->timestamp = timestamp_start; hdr->duration = timestamp_end - timestamp_start;