/*1This program is free software: you can redistribute it and/or modify2it under the terms of the GNU General Public License as published by3the Free Software Foundation, either version 3 of the License, or4(at your option) any later version.56This program is distributed in the hope that it will be useful,7but WITHOUT ANY WARRANTY; without even the implied warranty of8MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the9GNU General Public License for more details.1011You should have received a copy of the GNU General Public License12along with this program. If not, see <http://www.gnu.org/licenses/>.13*/1415#include "GCS_MAVLink.h"16#include <AP_HAL/AP_HAL_Boards.h>17#include "AP_Periph.h"18#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS19#include <hal.h>20#endif2122#if HAL_GCS_ENABLED2324MAV_RESULT GCS_MAVLINK_Periph::handle_preflight_reboot(const mavlink_command_int_t &packet, const mavlink_message_t &msg)25{26hal.scheduler->delay(10);27periph.prepare_reboot();28#if CONFIG_HAL_BOARD == HAL_BOARD_CHIBIOS29NVIC_SystemReset();30#elif CONFIG_HAL_BOARD == HAL_BOARD_SITL31HAL_SITL::actually_reboot();32#endif33}3435#endif // #if HAL_GCS_ENABLED363738