Skip to content

Commit d86c1c6

Browse files
committedJan 6, 2022
AP_OpticalFlow: fix example when OpticalFlow compiled out
1 parent 5a421c7 commit d86c1c6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎libraries/AP_OpticalFlow/examples/AP_OpticalFlow_test/AP_OpticalFlow_test.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,26 @@ class DummyVehicle {
3131
};
3232

3333
static DummyVehicle vehicle;
34+
#if AP_OPTICALFLOW_ENABLED
3435
static OpticalFlow optflow;
36+
#endif
3537

3638
void setup()
3739
{
3840
hal.console->printf("OpticalFlow library test ver 1.6\n");
3941

4042
hal.scheduler->delay(1000);
4143

44+
#if AP_OPTICALFLOW_ENABLED
4245
// flowSensor initialization
4346
optflow.init(-1);
4447

4548
if (!optflow.healthy()) {
46-
hal.console->printf("Failed to initialise PX4Flow ");
49+
hal.console->printf("Failed to initialise OpticalFlow");
4750
}
51+
#else
52+
hal.console->printf("OpticalFlow compiled out");
53+
#endif
4854

4955
hal.scheduler->delay(1000);
5056
}

0 commit comments

Comments
 (0)
Please sign in to comment.