HAL_PX4: if we have lost RC input then set channel 3 to 900

this allows failsafe to kick in
This commit is contained in:
Andrew Tridgell 2013-04-14 22:02:45 +10:00
parent 181f7368a3
commit d01d754ba8
2 changed files with 5 additions and 0 deletions

View File

@ -88,6 +88,10 @@ void PX4RCInput::_timer_tick(void)
bool rc_updated = false;
if (orb_check(_rc_sub, &rc_updated) == 0 && rc_updated) {
orb_copy(ORB_ID(input_rc), _rc_sub, &_rcin);
_last_input = _rcin.timestamp;
} else if (hrt_absolute_time() - _last_input > 300000) {
// we've lost RC input, force channel 3 low
_rcin.values[2] = 900;
}
perf_end(_perf_rcin);
}

View File

@ -25,6 +25,7 @@ private:
struct rc_input_values _rcin;
int _rc_sub;
uint64_t _last_read;
uint64_t _last_input;
bool _override_valid;
perf_counter_t _perf_rcin;
};