AP_OpticalFlow: fix warning in SITL compilation

This commit is contained in:
Peter Barker 2017-01-02 13:47:30 +11:00 committed by Randy Mackay
parent 588e59f524
commit 889ec829fc
1 changed files with 2 additions and 1 deletions

View File

@ -108,7 +108,8 @@ void AP_OpticalFlow_SITL::update(void)
if (_sitl->flow_delay != optflow_delay) {
// cope with updates to the delay control
if (_sitl->flow_delay > ARRAY_SIZE(optflow_data)) {
if (_sitl->flow_delay > 0 &&
(uint8_t)(_sitl->flow_delay) > ARRAY_SIZE(optflow_data)) {
_sitl->flow_delay = ARRAY_SIZE(optflow_data);
}
optflow_delay = _sitl->flow_delay;