1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 23:05:19 +03:00

added vbat sag compensation in CMS

This commit is contained in:
Nicola De Pasquale 2020-10-04 16:30:08 +02:00
parent 5db852a2f4
commit ff79f2927d

View file

@ -378,6 +378,10 @@ static uint8_t cmsx_d_min_gain;
static uint8_t cmsx_d_min_advance;
#endif
#ifdef USE_BATTERY_VOLTAGE_SAG_COMPENSATION
static uint8_t cmsx_vbat_sag_compensation;
#endif
#ifdef USE_ITERM_RELAX
static uint8_t cmsx_iterm_relax;
static uint8_t cmsx_iterm_relax_type;
@ -431,6 +435,9 @@ static const void *cmsx_profileOtherOnEnter(displayPort_t *pDisp)
cmsx_ff_smooth_factor = pidProfile->ff_smooth_factor;
#endif
#ifdef USE_BATTERY_VOLTAGE_SAG_COMPENSATION
cmsx_vbat_sag_compensation = pidProfile->vbat_sag_compensation;
#endif
return NULL;
}
@ -475,6 +482,10 @@ static const void *cmsx_profileOtherOnExit(displayPort_t *pDisp, const OSD_Entry
pidProfile->ff_smooth_factor = cmsx_ff_smooth_factor;
#endif
#ifdef USE_BATTERY_VOLTAGE_SAG_COMPENSATION
pidProfile->vbat_sag_compensation = cmsx_vbat_sag_compensation;
#endif
initEscEndpoints();
return NULL;
}
@ -519,6 +530,10 @@ static const OSD_Entry cmsx_menuProfileOtherEntries[] = {
{ "D_MIN ADV", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_d_min_advance, 0, 200, 1 }, 0 },
#endif
#ifdef USE_BATTERY_VOLTAGE_SAG_COMPENSATION
{ "VBAT_SAG_COMP", OME_UINT8, NULL, &(OSD_UINT8_t) { &cmsx_vbat_sag_compensation, 0, 150, 1 }, 0 },
#endif
{ "BACK", OME_Back, NULL, NULL, 0 },
{ NULL, OME_END, NULL, NULL, 0 }
};