Skip to content

Commit

Permalink
Update generate_model_header.sh
Browse files Browse the repository at this point in the history
- Unified brace style.
- Changed the indentation.
  • Loading branch information
pjueon committed Nov 20, 2023
1 parent 86f0a57 commit abc5b62
Showing 1 changed file with 12 additions and 10 deletions.
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

0 comments on commit abc5b62

Please sign in to comment.