Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
- Force band and mode to uppercase
- Fix bug with band and mode not finalising the string output to the OSD
- Changed RSSI dBm and SNR display outputs slightly. So that the OSD is more consistent
- Show mW symbol for power elements when no data is present. Again, more consistency and doesn't make people wonder why the elements are not showing up.
  • Loading branch information
MrD-RC committed Nov 9, 2024
1 parent ec014c5 commit 363bf09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/main/fc/fc_msp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "common/color.h"
#include "common/maths.h"
#include "common/streambuf.h"
#include "common/string_light.h"
#include "common/bitarray.h"
#include "common/time.h"
#include "common/utils.h"
Expand Down Expand Up @@ -2947,9 +2948,13 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
rxLinkStatistics.band[i] = sbufReadU8(src);
}

sl_toupperptr(rxLinkStatistics.band);

for (int i = 0; i < 6; i++) {
rxLinkStatistics.mode[i] = sbufReadU8(src);
}

sl_toupperptr(rxLinkStatistics.mode);
}

return MSP_RESULT_NO_REPLY;
Expand Down
10 changes: 6 additions & 4 deletions src/main/io/osd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,7 @@ static bool osdDrawSingleElement(uint8_t item)
if (rssi <= -100) {
tfp_sprintf(buff + 1, "%4d%c", rssi, SYM_DBM);
} else {
tfp_sprintf(buff + 1, "%3d%c%c", rssi, SYM_DBM, ' ');
tfp_sprintf(buff + 1, " %3d%c", rssi, SYM_DBM);
}
if (!failsafeIsReceivingRxData()){
TEXT_ATTRIBUTES_ADD_BLINK(elemAttr);
Expand Down Expand Up @@ -2560,7 +2560,7 @@ static bool osdDrawSingleElement(uint8_t item)
if (snrFiltered <= -10 || snrFiltered >= 10) {
tfp_sprintf(buff + 1, "%3d%c", snrFiltered, SYM_DB);
} else {
tfp_sprintf(buff + 1, "%2d%c%c", snrFiltered, SYM_DB, ' ');
tfp_sprintf(buff + 1, " %2d%c", snrFiltered, SYM_DB);
}
}
break;
Expand All @@ -2569,7 +2569,7 @@ static bool osdDrawSingleElement(uint8_t item)
case OSD_TX_POWER_UPLINK:
{
if (!failsafeIsReceivingRxData())
tfp_sprintf(buff, "%s%c", " ", SYM_BLANK);
tfp_sprintf(buff, "%s%c", " ", SYM_MW);
else
tfp_sprintf(buff, "%4d%c", rxLinkStatistics.uplinkTXPower, SYM_MW);
break;
Expand All @@ -2578,19 +2578,21 @@ static bool osdDrawSingleElement(uint8_t item)
case OSD_RX_POWER_DOWNLINK:
{
if (!failsafeIsReceivingRxData())
tfp_sprintf(buff, "%s%c%c", " ", SYM_BLANK, SYM_BLANK);
tfp_sprintf(buff, "%s%c%c", " ", SYM_MW, SYM_AH_DECORATION_DOWN);
else
tfp_sprintf(buff, "%4d%c%c", rxLinkStatistics.downlinkTXPower, SYM_MW, SYM_AH_DECORATION_DOWN);
break;
}
case OSD_RX_BAND:
displayWriteChar(osdDisplayPort, elemPosX++, elemPosY, SYM_RX_BAND);
strcat(buff, rxLinkStatistics.band);
buff[4] = '\0';
break;

case OSD_RX_MODE:
displayWriteChar(osdDisplayPort, elemPosX++, elemPosY, SYM_RX_MODE);
strcat(buff, rxLinkStatistics.mode);
buff[6] = '\0';
break;
#endif

Expand Down

0 comments on commit 363bf09

Please sign in to comment.