From edf1a21e9f51305bc880b51667aaabab96c7ec0b Mon Sep 17 00:00:00 2001 From: Kristoffer Richardsson Date: Wed, 18 Oct 2023 14:50:59 +0200 Subject: [PATCH] Correct param update initiated in the CF --- src/modules/src/param_logic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/src/param_logic.c b/src/modules/src/param_logic.c index 8a84e9f780..e7b4e1d495 100644 --- a/src/modules/src/param_logic.c +++ b/src/modules/src/param_logic.c @@ -578,6 +578,7 @@ void paramSetInt(paramVarId_t varid, int valuei) pk.data[0] = MISC_VALUE_UPDATED; pk.data[1] = varid.id & 0xffu; pk.data[2] = (varid.id >> 8) & 0xffu; + memcpy(&pk.data[3], &valuei, paramSize); pk.size = 3 + paramSize; const int sendResult = crtpSendPacket(&pk); if (sendResult == errQUEUE_FULL) @@ -605,9 +606,8 @@ void paramSetFloat(paramVarId_t varid, float valuef) pk.data[0] = MISC_VALUE_UPDATED; pk.data[1] = varid.id & 0xffu; pk.data[2] = (varid.id >> 8) & 0xffu; - pk.size = 3; - memcpy(&pk.data[2], &valuef, 4); - pk.size += 4; + memcpy(&pk.data[3], &valuef, 4); + pk.size = 3 + 4; const int sendResult = crtpSendPacket(&pk); if (sendResult == errQUEUE_FULL) {