From 368aeb8e8edb591e442997e392c63156606d6669 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 26 Feb 2019 14:37:31 +1100 Subject: [PATCH] AP_UAVCAN: refuse to reboot via CAN if armed --- libraries/AP_UAVCAN/AP_UAVCAN_Servers.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_UAVCAN/AP_UAVCAN_Servers.cpp b/libraries/AP_UAVCAN/AP_UAVCAN_Servers.cpp index f631c24d42..20c1ef1e05 100644 --- a/libraries/AP_UAVCAN/AP_UAVCAN_Servers.cpp +++ b/libraries/AP_UAVCAN/AP_UAVCAN_Servers.cpp @@ -88,6 +88,10 @@ class AP_UAVCAN_RestartRequestHandler : public uavcan::IRestartRequestHandler { public: bool handleRestartRequest(uavcan::NodeID request_source) override { // swiped from reboot handling in GCS_Common.cpp + if (hal.util->get_soft_armed()) { + // refuse reboot when armed + return false; + } AP_Notify *notify = AP_Notify::get_singleton(); if (notify) { AP_Notify::flags.firmware_update = 1;