-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a03f68e
commit 74ec39a
Showing
6 changed files
with
99 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
[email protected] | ||
branch=master | ||
modules=file,gpio,net,node,tmr,uart,wifi | ||
ssl-enabled=false | ||
debug-enabled=false | ||
fatfs-enabled=false | ||
u8g-fonts= | ||
u8g-display-i2c=ssd1306_128x64_i2c | ||
u8g-display-spi=ssd1306_128x64_hw_spi | ||
ucg-display-spi=ili9163_18x128x128_hw_spi, ucg_dev_ili9163_18x128x128, ucg_ext_ili9163_18 | ||
[email protected] | ||
branch=dev | ||
modules=node,file,gpio,wifi,net,tmr,uart,mqtt,spi,http,ucg,u8g | ||
ssl-enabled=true | ||
debug-enabled=true | ||
fatfs-enabled=true | ||
u8g-fonts=font_6x10,font_chikita | ||
u8g-display-i2c=uc1611_dogm240_i2c | ||
u8g-display-spi=pcf8812_96x65_hw_spi | ||
ucg-display-spi=seps225_16x128x128_uvis_hw_spi, ucg_dev_seps225_16x128x128_univision, ucg_ext_seps225_16 | ||
lfs-size=0x20000 | ||
spiffs-base=0 | ||
spiffs-size=0x200000 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
# | ||
# user_config.h has a number of defines the are replaced according to their | ||
# corresponding env X_???? variable. | ||
# | ||
# Define Uncomment if param Set to param | ||
# LUA_FLASH_STORE >0 Y | ||
# SPIFFS_FIXED_LOCATION >0 Y | ||
# SPIFFS_MAX_FILESYSTEM_SIZE >0 Y | ||
# BUILD_FATFS "true" | ||
# DEVELOP_VERSION "true" | ||
# SSL_ENABLED "true" | ||
# | ||
set -e | ||
|
||
# What is carried in the following variables is the sed replacement expression. | ||
# It makes all #defines commented by default. | ||
declare lfs="// #\\1" | ||
declare spiffs_base="// #\\1" | ||
declare spiffs_size="// #\\1" | ||
declare fatfs="// #\\1" | ||
declare debug="// #\\1" | ||
declare ssl="// #\\1" | ||
|
||
#if env var exists and is not "0" | ||
if [ ! -z "${X_LUA_FLASH_STORE}" ] && [ "${X_LUA_FLASH_STORE}" != "0" ]; then | ||
printf "Enabling LFS, size = %s\\n" "${X_LUA_FLASH_STORE}" | ||
lfs="#\\1 ${X_LUA_FLASH_STORE}" | ||
fi | ||
|
||
if [ ! -z "${X_SPIFFS_FIXED_LOCATION}" ] && [ "${X_SPIFFS_FIXED_LOCATION}" != "0" ]; then | ||
printf "SPIFFS location offset = %s\\n" "${X_SPIFFS_FIXED_LOCATION}" | ||
spiffs_base="#\\1 ${X_SPIFFS_FIXED_LOCATION}" | ||
fi | ||
|
||
if [ ! -z "${X_SPIFFS_MAX_FILESYSTEM_SIZE}" ] && [ "${X_SPIFFS_MAX_FILESYSTEM_SIZE}" != "0" ]; then | ||
printf "SPIFFS size = %s\\n" "${X_SPIFFS_MAX_FILESYSTEM_SIZE}" | ||
spiffs_size="#\\1 ${X_SPIFFS_MAX_FILESYSTEM_SIZE}" | ||
fi | ||
|
||
if [ "${X_DEBUG_ENABLED}" == "true" ]; then | ||
echo "Enabling debug mode" | ||
debug="#\\1" | ||
fi | ||
|
||
if [ "${X_FATFS_ENABLED}" == "true" ]; then | ||
echo "Enabling FatFS" | ||
fatfs="#\\1" | ||
fi | ||
|
||
if [ "${X_SSL_ENABLED}" == "true" ]; then | ||
echo "Enabling SSL" | ||
ssl="#\\1" | ||
fi | ||
|
||
# There's no option for sed in-place editing that works on both Unix and macOS | ||
# -> pipe to new file, then rename it | ||
sed -e "s!^.*\\(define *LUA_FLASH_STORE\\).*!$lfs!" \ | ||
-e "s!^.*\\(define *SPIFFS_FIXED_LOCATION\\).*!$spiffs_base!" \ | ||
-e "s!^.*\\(define *SPIFFS_MAX_FILESYSTEM_SIZE\\).*!$spiffs_size!" \ | ||
-e "s!^.*\\(define *BUILD_FATFS\\).*!$fatfs!" \ | ||
-e "s!^.*\\(define *CLIENT_SSL_ENABLE\\).*!$ssl!" \ | ||
-e "s!^.*\\(define *DEVELOP_VERSION\\).*!$debug!" \ | ||
user_config.h > user_config.h.new; | ||
|
||
mv user_config.h.new user_config.h; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.