From c07de6faac74fbbb6d14790f961e285c2a4783d3 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 27 Aug 2013 08:51:08 +0200 Subject: [PATCH] Guarding against zero RC channels --- src/ui/QGCPX4VehicleConfig.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc index cb1675fd3..09b3e17e3 100644 --- a/src/ui/QGCPX4VehicleConfig.cc +++ b/src/ui/QGCPX4VehicleConfig.cc @@ -421,6 +421,11 @@ void QGCPX4VehicleConfig::detectChannelInversion(int aert_index) void QGCPX4VehicleConfig::startCalibrationRC() { + if (chanCount < 5) { + QMessageBox::warning(0,tr("Warning! Not enough RC channels"), tr("Detected %1 radio channels. To operate PX4, you need at least 5 channels. Is the radio control connected?").arg(chanCount)); + return; + } + configEnabled = true; QMessageBox::warning(0,"Warning!","You are about to start radio calibration.\nPlease ensure all motor power is disconnected AND all props are removed from the vehicle.\nAlso ensure transmitter and receiver are powered and connected.\nRESET ALL TRIMS TO CENTER!\n\nDo not move the RC sticks, then click OK to confirm"); -- 2.22.0