-
Notifications
You must be signed in to change notification settings - Fork 232
Expand file tree
/
Copy pathmerge.bat
More file actions
42 lines (35 loc) · 1.45 KB
/
merge.bat
File metadata and controls
42 lines (35 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@echo off
REM Extract version number from tinyGS/src/Status.h
setlocal enabledelayedexpansion
REM Set TEST_API value from parameter, default to 0 if not provided
if "%1"=="" (
set TEST_API=0
) else (
set TEST_API=%1
)
set VERSION=
for /f "tokens=4 delims==; " %%A in ('findstr /c:"const uint32_t version" tinyGS\src\Status.h') do (
set "VERSION=%%A"
)
REM Eliminar comentarios y espacios
for /f "tokens=1 delims=;" %%B in ("!VERSION!") do set VERSION=%%B
set "VERSION=!VERSION: =!"
set build_dir=.pio\build
set esp32_dir=ESP32
set esp32s3_dir=ESP32-S3
set esp32c3_dir=ESP32-C3
set "PLATFORMIO_BUILD_FLAGS=-DTEST_API=%TEST_API%"
platformio run -e %esp32_dir% -e %esp32s3_dir% -e %esp32c3_dir%
esptool.py --chip esp32 merge_bin -o esp32_%VERSION%_merged.bin --flash_mode dio --flash_size 4MB ^
0x1000 %build_dir%\%esp32_dir%\bootloader.bin ^
0x8000 %build_dir%\%esp32_dir%\partitions.bin ^
0x10000 %build_dir%\%esp32_dir%\firmware.bin
esptool.py --chip esp32-s3 merge_bin -o esp32_s3_%VERSION%_merged.bin --flash_mode dio --flash_size 4MB ^
0x0 %build_dir%\%esp32s3_dir%\bootloader.bin ^
0x8000 %build_dir%\%esp32s3_dir%\partitions.bin ^
0x10000 %build_dir%\%esp32s3_dir%\firmware.bin
esptool.py --chip esp32-c3 merge_bin -o esp32_c3_%VERSION%_merged.bin --flash_mode dio --flash_size 4MB ^
0x1000 %build_dir%\%esp32c3_dir%\bootloader.bin ^
0x8000 %build_dir%\%esp32c3_dir%\partitions.bin ^
0x10000 %build_dir%\%esp32c3_dir%\firmware.bin
endlocal