Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic for generic platform (backport #553) #565

Merged
merged 1 commit into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/build_firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ fi
# Building specific firmware folder
echo "Building firmware for $RTOS platform $PLATFORM"

if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then
# Use the generic platform if directory found
if [ -d "$PREFIX/config/$RTOS/generic" ]; then
. $PREFIX/config/$RTOS/generic/build.sh
else
. $PREFIX/config/$RTOS/$PLATFORM/build.sh
Expand Down
8 changes: 4 additions & 4 deletions scripts/configure_firmware.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash
#! /bin/bash

set -e
set -o nounset
Expand All @@ -17,7 +17,7 @@ else
fi

# Check if configure script exists
if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ ! -f $PREFIX/config/$RTOS/generic/configure.sh ]; then
echo "No configuration step needed for generic platform $PLATFORM"
exit 0
Expand All @@ -32,7 +32,7 @@ fi
# Parsing micro-ROS arguments
if [ $# -lt 1 ]; then
echo "micro-ROS application name must be provided: ros2 run micro_ros_setup configure_firmware.sh [app name] [options]"
# Check if RTOS has app listing funcions and source in case
# Check if RTOS has app listing funcions and source in case
if [ -f $PREFIX/config/$RTOS/list_apps.sh ]; then
. $PREFIX/config/$RTOS/list_apps.sh
print_available_apps
Expand Down Expand Up @@ -80,7 +80,7 @@ while [[ $# -gt 0 ]]; do
done

# Configure specific firmware folder if needed
if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ -d "$PREFIX/config/$RTOS/generic" ]; then
echo "Configuring firmware for $RTOS platform $PLATFORM"
exec $PREFIX/config/$RTOS/generic/configure.sh $@
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/create_firmware_ws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fi
SKIP="microxrcedds_agent microxrcedds_client microcdr rosidl_typesupport_connext_cpp rosidl_typesupport_connext_c rosidl_typesupport_opensplice_cpp rosidl_typesupport_opensplice_c rmw_opensplice_cpp ros-${ROS_DISTRO}-cyclonedds ros-${ROS_DISTRO}-rti-connext-dds-cmake-module ros-${ROS_DISTRO}-rmw-connextdds-common ros-${ROS_DISTRO}-rmw-connextdds ros-${ROS_DISTRO}-rmw-cyclonedds-cpp google_benchmark_vendor performance_test_fixture ros-${ROS_DISTRO}-mimick-vendor rmw_cyclonedds_cpp rmw_connext_cpp rti-connext-dds-5.3.1 rmw_connextdds $EXTERNAL_SKIP"

# Check generic build
if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ -d "$PREFIX/config/$RTOS/generic" ]; then
TARGET_FOLDER=generic
else
TARGET_FOLDER=$PLATFORM
Expand Down
2 changes: 1 addition & 1 deletion scripts/flash_firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
fi

# Flash specific firmware folder if needed
if [ $PLATFORM != "generic" ] && [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ -f $PREFIX/config/$RTOS/generic/flash.sh ]; then
echo "Flashing firmware for $RTOS platform $PLATFORM"
. $PREFIX/config/$RTOS/generic/flash.sh
Expand Down