AP_Generator_RichenPower: allow operation with no generator present

This commit is contained in:
Peter Barker 2020-06-29 11:52:23 +10:00 committed by Randy Mackay
parent df8d8cefd6
commit c5ac42d985
1 changed files with 6 additions and 0 deletions

View File

@ -305,6 +305,12 @@ bool AP_Generator_RichenPower::pre_arm_check(char *failmsg, uint8_t failmsg_len)
// not configured in serial manager // not configured in serial manager
return true; return true;
} }
if (last_reading_ms == 0) {
// allow optional use of generator
snprintf(failmsg, failmsg_len, "no RichenPower generator present");
return true;
}
const uint32_t now = AP_HAL::millis(); const uint32_t now = AP_HAL::millis();
if (now - last_reading_ms > 2000) { // we expect @1Hz if (now - last_reading_ms > 2000) { // we expect @1Hz