Skip to content

Commit

Permalink
Corrected int types
Browse files Browse the repository at this point in the history
  • Loading branch information
MrD-RC committed Nov 3, 2024
1 parent 66e9be4 commit a807056
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2916,12 +2916,12 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)

#ifdef USE_RX_MSP
case MSP2_COMMON_SET_MSP_RC_LINK_STATS:
if (dataSize == 48) {
if (dataSize == 56) {

This comment has been minimized.

Copy link
@olliw42

olliw42 Nov 3, 2024

are these sizes correct?
in the older code parts it seems to be just the number of bytes ... here 6 times (and in the next 9.23...)

uint8_t sublinkID = sbufReadU8(src); // Sublink ID
sbufReadU8(src); // Valid link (Failsafe backup)
if (sublinkID == 1) {
// RSSI %
rxLinkStatistics.uplinkRSSI = -sbufReadU8(src);
sbufReadU8(src); // RSSI %
rxLinkStatistics.uplinkRSSI = -sbufReadU16(src);
rxLinkStatistics.downlinkLQ = sbufReadU8(src);
rxLinkStatistics.uplinkLQ = sbufReadU8(src);
rxLinkStatistics.uplinkSNR = sbufReadU8(src);
Expand All @@ -2931,12 +2931,12 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
break;

case MSP2_COMMON_SET_MSP_RC_INFO:
if (dataSize == 104) {
if (dataSize == 120) {
uint8_t sublinkID = sbufReadU8(src);

if (sublinkID == 1) {
rxLinkStatistics.uplinkTXPower = sbufReadU8(src);
rxLinkStatistics.downlinkTXPower = sbufReadU8(src);
rxLinkStatistics.uplinkTXPower = sbufReadU16(src);
rxLinkStatistics.downlinkTXPower = sbufReadU16(src);

for (int i = 0; i < 4 - 1; i++) {
rxLinkStatistics.band[i] = sbufReadU8(src);
Expand Down

0 comments on commit a807056

Please sign in to comment.