AP_Airspeed: return when airspeed init fails

This commit is contained in:
Andrew Tridgell 2013-08-26 08:11:52 +10:00
parent 1230df8b0d
commit c6c59174b3

View File

@ -96,6 +96,7 @@ void AP_Airspeed::init()
if (_ets_fd == -1) { if (_ets_fd == -1) {
hal.console->println("Failed to open ETS airspeed driver"); hal.console->println("Failed to open ETS airspeed driver");
_enable.set(0); _enable.set(0);
return;
} }
if (OK != ioctl(_ets_fd, SENSORIOCSPOLLRATE, 100) || if (OK != ioctl(_ets_fd, SENSORIOCSPOLLRATE, 100) ||
OK != ioctl(_ets_fd, SENSORIOCSQUEUEDEPTH, 15)) { OK != ioctl(_ets_fd, SENSORIOCSQUEUEDEPTH, 15)) {