mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-30 07:33:35 +08:00
This adds a check for the previous SYS_AUTOSTART id. If it is still the old/previous SYS_AUTOSTART id, it will flash the new bootloader as well as set the proper SYS_AUTOSTART id.
40 lines
783 B
Bash
40 lines
783 B
Bash
#!/bin/sh
|
|
#
|
|
# board specific defaults
|
|
#------------------------------------------------------------------------------
|
|
|
|
param set-default SYS_AUTOSTART 4061
|
|
|
|
param set-default BAT1_V_DIV 9.0
|
|
|
|
param set-default COM_ARM_SDCARD 0
|
|
|
|
param set-default SENS_EXT_I2C_PRB 0
|
|
|
|
param set-default EKF2_MULTI_IMU 1
|
|
param set-default EKF2_MULTI_MAG 1
|
|
param set-default SENS_IMU_MODE 0
|
|
param set-default SENS_MAG_MODE 0
|
|
|
|
param set-default EV_TSK_STAT_DIS 1
|
|
|
|
set LOGGER_ARGS "-m mavlink"
|
|
|
|
# Start esc
|
|
tap_esc start -d /dev/ttyS4 -n 4
|
|
|
|
# Transition from previous non open-source flight stack
|
|
if param compare SYS_AUTOSTART 4001
|
|
then
|
|
param reset_all
|
|
tune_control play -t 4
|
|
sleep 2
|
|
if bl_update /etc/extras/bootloader.bin
|
|
then
|
|
tune_control play -t 3
|
|
else
|
|
tune_control play -t 5
|
|
fi
|
|
sleep 2
|
|
fi
|