px4-firmware/Tools/serial/rc.serial.jinja

31 lines
587 B
Django/Jinja

{# jinja template to generate the serial autostart script. #}
# serial autostart script generated with generate_serial_config.py
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
if [ $SERIAL_DEV != none ]
then
{% if not constrained_flash -%}
echo "Starting {{ command.label }} on $SERIAL_DEV"
{% endif -%}
{{ command.command }}
fi
{% endfor %}
unset i
unset SERIAL_DEV
unset PRT
unset PRT_F
unset BAUD_PARAM