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

Update generate_model_header.sh file #112

Merged
merged 1 commit into from
Nov 20, 2023
Merged
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
22 changes: 12 additions & 10 deletions scripts/generate_model_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,40 @@ cat << EOF > $HEADER_FILE

#include <string>

namespace GPIO {
enum class Model {
namespace GPIO
{
enum class Model
{
EOF

# Add enum class items using a for loop
for MODEL in $JETSON_MODELS; do
echo " $MODEL," >> $HEADER_FILE
echo " $MODEL," >> $HEADER_FILE
done

# Add remaining part
cat << EOF >> $HEADER_FILE
};
};

// names
constexpr const char* MODEL_NAMES[] = {
// names
constexpr const char* MODEL_NAMES[] = {
EOF

# Add enum names using a for loop
for MODEL in $JETSON_MODELS; do
echo " \"$MODEL\"," >> $HEADER_FILE
echo " \"$MODEL\"," >> $HEADER_FILE
done

# Add remaining part
cat << EOF >> $HEADER_FILE
};
};

// alias
// alias
EOF

# Add enum alias generation commands
for MODEL in $JETSON_MODELS; do
echo " constexpr Model $MODEL = Model::$MODEL;" >> $HEADER_FILE
echo " constexpr Model $MODEL = Model::$MODEL;" >> $HEADER_FILE
done

# Add remaining part
Expand Down