mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-25 01:05:27 +03:00
Receive RSSI value via MSP/SmartPort
This commit is contained in:
parent
800e44906d
commit
f87e768ce6
2 changed files with 13 additions and 0 deletions
|
@ -1974,6 +1974,17 @@ static mspResult_e mspProcessInCommand(uint8_t cmdMSP, sbuf_t *src)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
case MSP_TX_INFO:
|
||||||
|
{
|
||||||
|
uint8_t rssi_tx = sbufReadU8(src);
|
||||||
|
// Ignore rssi from MSP when RSSI channel or RSSIPWM feature is enabled
|
||||||
|
if (rxConfig()->rssi_channel == 0 && !featureConfigured(FEATURE_RSSI_ADC)) {
|
||||||
|
// Range of rssi_tx is [1;100]. rssi should be in [0;1023];
|
||||||
|
rssi = (uint16_t)((rssi_tx / 100.0f) * 1023.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// we do not know how to handle the (valid) message, indicate error MSP $M!
|
// we do not know how to handle the (valid) message, indicate error MSP $M!
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
|
|
|
@ -230,6 +230,8 @@
|
||||||
#define MSP_BEEPER_CONFIG 184
|
#define MSP_BEEPER_CONFIG 184
|
||||||
#define MSP_SET_BEEPER_CONFIG 185
|
#define MSP_SET_BEEPER_CONFIG 185
|
||||||
|
|
||||||
|
#define MSP_TX_INFO 186
|
||||||
|
|
||||||
//
|
//
|
||||||
// Multwii original MSP commands
|
// Multwii original MSP commands
|
||||||
//
|
//
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue