mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 03:50:02 +03:00
Adjust aux channel
This commit is contained in:
parent
5f01063dd2
commit
0213c263bc
1 changed files with 3 additions and 1 deletions
|
@ -1116,8 +1116,10 @@ STATIC_UNIT_TESTED bool osdProcessStats1(timeUs_t currentTimeUs)
|
|||
}
|
||||
|
||||
if (VISIBLE(osdElementConfig()->item_pos[OSD_AUX_VALUE])) {
|
||||
const uint8_t auxChannel = osdConfig()->aux_channel + NON_AUX_CHANNEL_COUNT - 1;
|
||||
if (currentTimeUs > osdAuxRefreshTimeUs) {
|
||||
osdAuxValue = (constrain(rcData[osdConfig()->aux_channel - 1], PWM_RANGE_MIN, PWM_RANGE_MAX) - PWM_RANGE_MIN) * osdConfig()->aux_scale / (PWM_RANGE_MAX - PWM_RANGE_MIN);
|
||||
// aux channel start after main channels
|
||||
osdAuxValue = (constrain(rcData[auxChannel], PWM_RANGE_MIN, PWM_RANGE_MAX) - PWM_RANGE_MIN) * osdConfig()->aux_scale / PWM_RANGE;
|
||||
osdAuxRefreshTimeUs = currentTimeUs + REFRESH_1S;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue