2019-10-19 09:23:23 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
2021-03-09 11:16:44 -05:00
|
|
|
# board specific defaults
|
2019-10-19 09:23:23 -07:00
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
|
|
2019-12-09 09:39:17 -08:00
|
|
|
#
|
|
|
|
|
# Summary:
|
|
|
|
|
# Flight Core can be used on many airframes, but is meant to be paired with
|
|
|
|
|
# VOXL (either through a cable or in the combo board flavor). For this reason
|
|
|
|
|
# this script has a bit more Logic (aka Bobby Tarantino) than normal.
|
|
|
|
|
#
|
|
|
|
|
# Flight Core Version Information:
|
2020-01-30 21:04:44 -08:00
|
|
|
# V106 - Flight Core Stand Alone configuration
|
2019-12-09 09:39:17 -08:00
|
|
|
# V110 - Flight Core VOXL-Flight configuration
|
|
|
|
|
#
|
2019-10-19 09:23:23 -07:00
|
|
|
|
2019-12-09 09:39:17 -08:00
|
|
|
#
|
|
|
|
|
# Common settings across Flight Core configurations
|
|
|
|
|
#
|
2021-01-07 10:12:20 -05:00
|
|
|
|
2021-02-08 21:03:49 -05:00
|
|
|
# Disable safety switch by default (pull high to 3.3V to enable)
|
|
|
|
|
# V106 - J13 pin 5
|
|
|
|
|
# V110 - J1011 pin 5
|
|
|
|
|
param set-default CBRK_IO_SAFETY 22027
|
2021-02-01 21:15:59 -05:00
|
|
|
|
2019-12-09 09:39:17 -08:00
|
|
|
#
|
|
|
|
|
# Stand Alone configuration
|
|
|
|
|
#
|
2020-01-30 21:04:44 -08:00
|
|
|
if ver hwtypecmp V106
|
2019-12-09 09:39:17 -08:00
|
|
|
then
|
2020-01-30 21:04:44 -08:00
|
|
|
echo "Configuring Flight Core - V106"
|
2019-10-19 09:23:23 -07:00
|
|
|
|
|
|
|
|
#
|
2020-08-18 13:42:39 -07:00
|
|
|
# In Flight Core, J1 can be setup to be used as a serial port for TELEM2
|
|
|
|
|
# and connected to VOXL via cables. We'll configure this out of the box.
|
|
|
|
|
# The user can later change this if they want, as these are configurable
|
|
|
|
|
# and not necessarily required to be used with VOXL.
|
2019-10-19 09:23:23 -07:00
|
|
|
#
|
2019-12-09 09:39:17 -08:00
|
|
|
if [ $AUTOCNF = no ]
|
|
|
|
|
then
|
|
|
|
|
if param compare MAV_1_CONFIG 0
|
|
|
|
|
then
|
2020-01-30 21:04:44 -08:00
|
|
|
echo "V106 - Defualt configuration TELEM2 on /dev/ttyS4 at 921600 in Normal Mode"
|
2021-02-08 21:03:49 -05:00
|
|
|
param set-default MAV_1_CONFIG 102 # TELEM2
|
|
|
|
|
param set-default MAV_1_MODE 2 # Onboard
|
|
|
|
|
param set-default SER_TEL2_BAUD 921600 # VIO data
|
2019-12-09 09:39:17 -08:00
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# User is setting defaults, so let's do it!
|
|
|
|
|
if [ $AUTOCNF = yes ]
|
|
|
|
|
then
|
2020-01-30 21:04:44 -08:00
|
|
|
echo "V106 - Auto Configuring TELEM2 on /dev/ttyS4 at 921600 in Normal Mode"
|
2021-02-08 21:03:49 -05:00
|
|
|
param set-default MAV_1_CONFIG 102 # TELEM2
|
|
|
|
|
param set-default MAV_1_MODE 2 # Onboard
|
|
|
|
|
param set-default SER_TEL2_BAUD 921600 # VIO data
|
2019-12-09 09:39:17 -08:00
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# VOXL-Flight configuration
|
|
|
|
|
#
|
|
|
|
|
if ver hwtypecmp V110
|
|
|
|
|
then
|
|
|
|
|
echo "Configuring VOXL-Flight - V110"
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# TELEM2 port is physically routed in the PCB, thus not configurable.
|
2020-08-18 13:42:39 -07:00
|
|
|
# The following will detect a fresh install, or if the user has changed the setting and
|
|
|
|
|
# revert to the VOXL-Flight defaults. This does allow the user to change the mode and
|
|
|
|
|
# baud rates and mode if they choose to do so, although VOXL is expecting what is set below
|
2019-10-19 09:23:23 -07:00
|
|
|
#
|
2019-12-09 09:39:17 -08:00
|
|
|
if [ $AUTOCNF = no ]
|
|
|
|
|
then
|
|
|
|
|
if ! param compare MAV_1_CONFIG 102
|
|
|
|
|
then
|
|
|
|
|
echo "V110 - Defualt configuration TELEM2 on /dev/ttyS4 at 921600 in Normal Mode"
|
2021-02-08 21:03:49 -05:00
|
|
|
param set-default MAV_1_CONFIG 102 # TELEM2
|
|
|
|
|
param set-default MAV_1_MODE 2 # Onboard
|
|
|
|
|
param set-default SER_TEL2_BAUD 921600
|
2019-12-09 09:39:17 -08:00
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# User is setting defaults, so let's do it!
|
|
|
|
|
if [ $AUTOCNF = yes ]
|
|
|
|
|
then
|
|
|
|
|
echo "V110 - Auto Configuring TELEM2 on /dev/ttyS4 at 921600 in Normal Mode"
|
2021-02-08 21:03:49 -05:00
|
|
|
param set-default MAV_1_CONFIG 102 # TELEM2
|
|
|
|
|
param set-default MAV_1_MODE 2 # Onboard
|
|
|
|
|
param set-default SER_TEL2_BAUD 921600
|
2019-12-09 09:39:17 -08:00
|
|
|
fi
|
2019-10-19 09:23:23 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
safety_button start
|