Skip to content

Commit

Permalink
buuild suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Kennard committed Mar 14, 2022
1 parent d033175 commit 29fe2c6
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
43 changes: 43 additions & 0 deletions buildsuffix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/csh -f

setenv SDKCONFIG "sdkconfig"
if("$1" != "") setenv SDKCONFIG "$1"

if(! -e "$SDKCONFIG") then
echo "Missing $SDKCONFIG"
exit 0
endif

# Match the code in revk.c for OTA suffix defaults

# suffix1
grep -q CONFIG_IDF_TARGET_ESP32=y "$SDKCONFIG"
if(! $status) echo -n "-S1"
grep -q CONFIG_IDF_TARGET_ESP32S2=y "$SDKCONFIG"
if(! $status) echo -n "-S2"
grep -q CONFIG_IDF_TARGET_ESP32S3=y "$SDKCONFIG"
if(! $status) echo -n "-S3"
grep -q CONFIG_IDF_TARGET_ESPC3=y "$SDKCONFIG"
if(! $status) echo -n "-C3"
grep -q CONFIG_IDF_TARGET_ESPH2=y "$SDKCONFIG"
if(! $status) echo -n "-H2"

# suffix2
grep -q CONFIG_FREERTOS_UNICORE=y "$SDKCONFIG"
if(! $status) echo -n "-SOLO"

# suffix3
grep -q CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y "$SDKCONFIG"
if(! $status) then
grep -q CONFIG_ESP32_SPIRAM_SUPPORT=y "$SDKCONFIG"
if(! $status) echo -n "-PICO"
endif

# suffix4
grep -q CONFIG_ESP32_REV_MIN_3=y "$SDKCONFIG"
if(! $status) echo -n "-V3"
grep -q CONFIG_ESP32_REV_MIN_2=y "$SDKCONFIG"
if(! $status) echo -n "-V2"
grep -q CONFIG_ESP32_REV_MIN_1=y "$SDKCONFIG"
if(! $status) echo -n "-V1"

28 changes: 28 additions & 0 deletions setbuildsuffix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/csh -f
if("$1" == "") then
echo "Specify suffix"
exit 1
endif
setenv BUILDSUFFIX "$1"
shift
setenv SDKCONFIG "sdkconfig"
if("$1" != "") setenv SDKCONFIG "$1"

if(! -e "$SDKCONFIG") then
echo "Missing $SDKCONFIG"
exit 0
endif

rm -f "$SDKCONFIG".new

if("$BUILDSUFFIX" =~ *-PICO*) then
sed -e 's/# CONFIG_ESP32_SPIRAM_SUPPORT is not set/CONFIG_ESP32_SPIRAM_SUPPORT=y/' -e 's/# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set/CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y/' -e 's/CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y/# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set/' -e 's/CONFIG_FREERTOS_UNICORE=y/# CONFIG_FREERTOS_UNICORE is not set/' "$SDKCONFIG" > "$SDKCONFIG".new
else if("$BUILDSUFFIX" =~ *-SOLO*) then
sed -e 's/CONFIG_ESP32_SPIRAM_SUPPORT=y/# CONFIG_ESP32_SPIRAM_SUPPORT is not set/' -e 's/# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set/CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y/' -e 's/CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y/# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set/' -e 's/# CONFIG_FREERTOS_UNICORE is not set/CONFIG_FREERTOS_UNICORE=y/' "$SDKCONFIG" > "$SDKCONFIG".new
else
sed -e 's/CONFIG_ESP32_SPIRAM_SUPPORT=y/# CONFIG_ESP32_SPIRAM_SUPPORT is not set/' -e 's/# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set/CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y/' -e 's/CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y/# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set/' -e 's/CONFIG_FREERTOS_UNICORE=y/# CONFIG_FREERTOS_UNICORE is not set/' "$SDKCONFIG" > "$SDKCONFIG".new
endif

mv -f "$SDKCONFIG".new "$SDKCONFIG"


0 comments on commit 29fe2c6

Please sign in to comment.