2018-06-07 08:58:23 -03:00
|
|
|
{# jinja template to generate the serial autostart script. #}
|
|
|
|
|
|
|
|
# serial autostart script generated with generate_serial_config.py
|
|
|
|
|
|
|
|
|
2018-08-27 06:35:11 -03:00
|
|
|
set PRT_F /etc/init.d/rc.serial_port
|
|
|
|
|
|
|
|
{% for command in commands -%}
|
|
|
|
set PRT {{ command.port_param_name }}
|
|
|
|
{% if command.multi_instance -%}
|
|
|
|
set i {{ command.instance }}
|
|
|
|
{% endif -%}
|
|
|
|
# get the device & baudrate
|
|
|
|
sh $PRT_F
|
2019-02-24 11:53:45 -04:00
|
|
|
if [ $SERIAL_DEV != none ]; then
|
2018-08-27 06:35:11 -03:00
|
|
|
{% if not constrained_flash -%}
|
|
|
|
echo "Starting {{ command.label }} on $SERIAL_DEV"
|
|
|
|
{% endif -%}
|
|
|
|
{{ command.command }}
|
|
|
|
fi
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
|
2018-12-10 16:20:08 -04:00
|
|
|
{% for serial_device in serial_devices -%}
|
|
|
|
unset PRT_{{ serial_device.tag }}_
|
|
|
|
{% endfor %}
|
2018-08-27 06:35:11 -03:00
|
|
|
unset i
|
|
|
|
unset SERIAL_DEV
|
|
|
|
unset PRT
|
|
|
|
unset PRT_F
|
|
|
|
unset BAUD_PARAM
|
2018-12-10 16:20:08 -04:00
|
|
|
unset MAV_ARGS
|
2018-06-07 08:58:23 -03:00
|
|
|
|