Skip to content

Commit

Permalink
Merge pull request #1328 from bitcraze/krichardsson/param-update
Browse files Browse the repository at this point in the history
Correct param update initiated in the CF
  • Loading branch information
tobbeanton authored Oct 18, 2023
2 parents 37e5d7f + edf1a21 commit 2733505
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/src/param_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 2733505

Please sign in to comment.