mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 22:35:23 +03:00
added ability to assign one of aux1..4 channels as RSSI by the-kenny
git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@416 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
This commit is contained in:
parent
91d64fc6c1
commit
01eaf85510
4 changed files with 12 additions and 1 deletions
8
src/mw.c
8
src/mw.c
|
@ -452,6 +452,14 @@ void loop(void)
|
|||
mwDisarm();
|
||||
}
|
||||
|
||||
// Read value of AUX channel as rssi
|
||||
// 0 is disable, 1-4 is AUX{1..4}
|
||||
if (mcfg.rssi_aux_channel > 0) {
|
||||
const int16_t rssiChannelData = rcData[AUX1 + mcfg.rssi_aux_channel - 1];
|
||||
// Range of rssiChannelData is [1000;2000]. rssi should be in [0;1023];
|
||||
rssi = (uint16_t)((constrain(rssiChannelData - 1000, 0, 1000) / 1000.0f) * 1023.0f);
|
||||
}
|
||||
|
||||
// Failsafe routine
|
||||
if (feature(FEATURE_FAILSAFE)) {
|
||||
if (failsafeCnt > (5 * cfg.failsafe_delay) && f.ARMED) { // Stabilize, and set Throttle to specified level
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue