Skip to content

Commit dac523c

Browse files
committed
Update build and deploy scripts
1 parent 25bbc17 commit dac523c

10 files changed

+68
-32
lines changed
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
# Build MicroPython-LVGL firmware for: Generic ESP32 boards
1+
#!/bin/bash
2+
3+
# Build MicroPython-LVGL firmware for ESP32 boards
24

35
source env-variables-micropython.sh
46
source env-variables-esp32.sh
57

6-
BOARD=ESP32_GENERIC
7-
VARIANT=SPIRAM
8+
source menu-esp32.sh
9+
if [ -z "$BOARD" ]; then
10+
exit 1
11+
fi
812

913
cd $MICROPYTHON
1014
make -C mpy-cross
1115

1216
cd $MICROPYTHON/ports/esp32
13-
make submodules
1417
make BOARD=$BOARD VARIANT=$VARIANT

scripts/build-m5core2.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/build-unix.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Build MicroPython-LVGL app for: Unix/Linux systems
24

35
source env-variables-micropython.sh

scripts/clean.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Clear build directories
24

35
ORIGINAL_DIR=$PWD
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
# Deploy firmware to device: Generic ESP32 boards
1+
#!/bin/bash
2+
3+
# Deploy firmware ESP32 boards
24

35
source env-variables-micropython.sh
46
source env-variables-esp32.sh
57

6-
BOARD=ESP32_GENERIC
7-
VARIANT=SPIRAM
8+
source menu-esp32.sh
9+
if [ -z "$BOARD" ]; then
10+
exit 1
11+
fi
812

913
cd $MICROPYTHON/ports/esp32
1014
make deploy BOARD=$BOARD VARIANT=$VARIANT

scripts/deploy-m5core2.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

scripts/env-variables-esp32.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
#!/bin/bash
2+
13
# Set environment variables for ESP32 development
24

35
ESPIDF=~/esp/esp-idf-5-2-3
4-
5-
BOARD=ESP32_GENERIC
6-
76
source $ESPIDF/export.sh
87

scripts/env-variables-micropython.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Set environment variables for MicroPython development
24

35
BUILD_VERBOSE=1

scripts/erase-flash-esp32.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1+
#!/bin/bash
2+
13
# Erase the flash memory of the ESP32 board
24

35
source env-variables-micropython.sh
46
source env-variables-esp32.sh
57

8+
source menu-esp32.sh
9+
if [ -z "$BOARD" ]; then
10+
exit 1
11+
fi
12+
613
cd $MICROPYTHON/ports/esp32
714
make erase BOARD=$BOARD

scripts/menu-esp32.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# Show ESP32 board / variant selector menu
4+
5+
# Array of configurations
6+
configs=(
7+
"ESP32_GENERIC"
8+
"ESP32_GENERIC SPIRAM"
9+
"ESP32_GENERIC_S3"
10+
"ESP32_GENERIC_S3 SPIRAM_OCT"
11+
"M5STACK_CORE2"
12+
)
13+
14+
# Function to display menu and get user choice
15+
show_menu() {
16+
echo "Select a configuration:"
17+
for i in "${!configs[@]}"; do
18+
echo "$((i+1)). ${configs[$i]}"
19+
done
20+
read -p "Enter your choice (1-${#configs[@]}): " choice
21+
return $choice
22+
}
23+
24+
# Display menu and get user choice
25+
show_menu
26+
choice=$?
27+
28+
# Validate user input
29+
if [[ $choice -lt 1 || $choice -gt ${#configs[@]} ]]; then
30+
echo "Invalid choice. Exiting."
31+
exit 1
32+
fi
33+
34+
# Set BOARD and VARIANT based on user choice
35+
selected_config=(${configs[$((choice-1))]})
36+
BOARD=${selected_config[0]}
37+
VARIANT=${selected_config[1]:-""}
38+
39+
echo "Selected configuration: BOARD=$BOARD, VARIANT=$VARIANT"

0 commit comments

Comments
 (0)