AP_BattMoniter: add reset remaining per-instance rename existing to _mask

This commit is contained in:
Iampete1 2021-03-26 20:14:21 +00:00 committed by Andrew Tridgell
parent 0fe38da522
commit 9fdceeded3
2 changed files with 3 additions and 2 deletions

View File

@ -554,7 +554,7 @@ void AP_BattMonitor::checkPoweringOff(void)
reset battery remaining percentage for batteries that integrate to
calculate percentage remaining
*/
bool AP_BattMonitor::reset_remaining(uint16_t battery_mask, float percentage)
bool AP_BattMonitor::reset_remaining_mask(uint16_t battery_mask, float percentage)
{
static_assert(AP_BATT_MONITOR_MAX_INSTANCES <= 16, "More batteries are enabled then can be reset");
bool ret = true;

View File

@ -208,7 +208,8 @@ public:
void checkPoweringOff(void);
// reset battery remaining percentage
bool reset_remaining(uint16_t battery_mask, float percentage);
bool reset_remaining_mask(uint16_t battery_mask, float percentage);
bool reset_remaining(uint8_t instance, float percentage) { return reset_remaining_mask(1U<<instance, percentage);}
static const struct AP_Param::GroupInfo var_info[];