AP_AccelCal: check return of get_calibrator

resolves compiler warning
This commit is contained in:
Randy Mackay 2016-04-23 09:58:20 +09:00 committed by Tom Pittenger
parent 39560f9af8
commit f70072c54b
1 changed files with 4 additions and 1 deletions

View File

@ -56,7 +56,10 @@ void AP_AccelCal::update()
case ACCEL_CAL_WAITING_FOR_ORIENTATION: {
// if we're waiting for orientation, first ensure that all calibrators are on the same step
uint8_t step;
cal = get_calibrator(0);
if ((cal = get_calibrator(0)) == NULL) {
fail();
return;
}
step = cal->get_num_samples_collected()+1;
for(uint8_t i=1 ; (cal = get_calibrator(i)) ; i++) {