lv_micropython/scripts/menu-esp32.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
907 B
Bash
Raw Normal View History

2025-03-15 13:46:23 +01:00
#!/bin/bash
# Show ESP32 board / variant selector menu
# Array of configurations
configs=(
"ESP32_GENERIC"
"ESP32_GENERIC SPIRAM"
"ESP32_GENERIC_S3"
"ESP32_GENERIC_S3 SPIRAM_OCT"
"M5STACK_CORE2"
)
# Function to display menu and get user choice
show_menu() {
echo "Select a configuration:"
for i in "${!configs[@]}"; do
echo "$((i+1)). ${configs[$i]}"
done
read -p "Enter your choice (1-${#configs[@]}): " choice
return $choice
}
# Display menu and get user choice
show_menu
choice=$?
# Validate user input
if [[ $choice -lt 1 || $choice -gt ${#configs[@]} ]]; then
echo "Invalid choice. Exiting."
exit 1
fi
# Set BOARD and BOARD_VARIANT based on user choice
2025-03-15 13:46:23 +01:00
selected_config=(${configs[$((choice-1))]})
BOARD=${selected_config[0]}
BOARD_VARIANT=${selected_config[1]:-""}
2025-03-15 13:46:23 +01:00
echo "Selected configuration: BOARD=$BOARD, BOARD_VARIANT=$BOARD_VARIANT"