From 2d84608daa9cbdf7f37e0716374bd89573bd58f3 Mon Sep 17 00:00:00 2001 From: azol <75358050@qq.com> Date: Sat, 24 Feb 2018 14:27:46 +0800 Subject: [PATCH] disable runcam camera control in runaway takeoff status --- src/main/io/rcdevice_cam.c | 2 +- src/test/unit/rcdevice_unittest.cc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/io/rcdevice_cam.c b/src/main/io/rcdevice_cam.c index a06c23338..d2346b75d 100644 --- a/src/main/io/rcdevice_cam.c +++ b/src/main/io/rcdevice_cam.c @@ -225,7 +225,7 @@ static void rcdevice5KeySimulationProcess(timeUs_t currentTimeUs) } #endif - if (ARMING_FLAG(ARMED)) { + if (ARMING_FLAG(ARMED) || getArmingDisableFlags() & ARMING_DISABLED_RUNAWAY_TAKEOFF) { return; } diff --git a/src/test/unit/rcdevice_unittest.cc b/src/test/unit/rcdevice_unittest.cc index ff4fe383f..7239f4c48 100644 --- a/src/test/unit/rcdevice_unittest.cc +++ b/src/test/unit/rcdevice_unittest.cc @@ -1615,4 +1615,5 @@ extern "C" { uint8_t armingFlags = 0; bool cmsInMenu; uint32_t resumeRefreshAt = 0; + int getArmingDisableFlags(void) {return 0;} }