From 4cff5656504d42b766ac461c46af8e81c13237c3 Mon Sep 17 00:00:00 2001 From: Bryan Biedenkapp Date: Wed, 7 Sep 2022 15:24:41 -0400 Subject: [PATCH] minor code cleanup; --- p25/lc/TSBK.cpp | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/p25/lc/TSBK.cpp b/p25/lc/TSBK.cpp index b8e01b22..bb7bfbaf 100644 --- a/p25/lc/TSBK.cpp +++ b/p25/lc/TSBK.cpp @@ -921,31 +921,24 @@ void TSBK::encode(uint8_t* data, bool rawTSBK, bool noTrellis) tmS |= i; } - // fix Year from from 1900 to from 2000 + // fix year from from 1900 to, from 2000 tmY = tmY - 100U; - tsbkValue = 0xE0U + // VL, VT and VD flags set - ((lto >> 8) & 0x0F); // LTO MSB (Upper 4-bits) - tsbkValue = (tsbkValue << 8) + - (lto & 0xFFU); // LTO LSB + tsbkValue = 0xE0U + // VL, VT and VD flags set + ((lto >> 8) & 0x0F); // LTO MSB (Upper 4-bits) + tsbkValue = (tsbkValue << 8) + (lto & 0xFFU); // LTO LSB // Date - tsbkValue = (tsbkValue << 4) + - (tmM & 0x0FU); // Month - tsbkValue = (tsbkValue << 5) + - (tmMDAY & 0x1FU); // Day of Month - tsbkValue = (tsbkValue << 13) + - (tmY & 0x1FFFU); // Year - tsbkValue = (tsbkValue << 2); // Reserved + tsbkValue = (tsbkValue << 4) + (tmM & 0x0FU); // Month + tsbkValue = (tsbkValue << 5) + (tmMDAY & 0x1FU); // Day of Month + tsbkValue = (tsbkValue << 13) + (tmY & 0x1FFFU); // Year + tsbkValue = (tsbkValue << 2); // Reserved // Time - tsbkValue = (tsbkValue << 5) + - (tmH & 0x1FU); // Hour - tsbkValue = (tsbkValue << 6) + - (tmMin & 0x3FU); // Minute - tsbkValue = (tsbkValue << 6) + - (tmS & 0x3FU); // Seconds - tsbkValue = (tsbkValue << 7); // Reserved + tsbkValue = (tsbkValue << 5) + (tmH & 0x1FU); // Hour + tsbkValue = (tsbkValue << 6) + (tmMin & 0x3FU); // Minute + tsbkValue = (tsbkValue << 6) + (tmS & 0x3FU); // Seconds + tsbkValue = (tsbkValue << 7); // Reserved #if DEBUG_P25_TSBK LogDebug(LOG_P25, "TSBK_OSP_TIME_DATE_ANN, tmM = %u, tmMDAY = %u, tmY = %u, tmH = %u, tmMin = %u, tmS = %u", tmM, tmMDAY, tmY, tmH, tmMin, tmS);