From d018a325455552a23e53aa33c75ca622c94860f1 Mon Sep 17 00:00:00 2001 From: mirkix Date: Mon, 11 Jul 2016 22:46:16 +0200 Subject: [PATCH] Plane: Only init optflow when enabled by parameter --- ArduPlane/system.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArduPlane/system.cpp b/ArduPlane/system.cpp index af6a773c4e..7fc688eeba 100644 --- a/ArduPlane/system.cpp +++ b/ArduPlane/system.cpp @@ -246,6 +246,10 @@ void Plane::init_ardupilot() // initialise sensor #if OPTFLOW == ENABLED + if (!optflow.enabled()) { + return; + } + optflow.init(); #endif