Commit 16ef39e2 authored by Johny Mattsson's avatar Johny Mattsson
Browse files

idf4: overhaul to new build system, part 1 of 3

Yet to come:
  - part 2: dealing with deprecated and removed APIs
  - part 3: making it actually work again
parent 8e0e0cb3
menu "Displays"
depends on NODEMCU_CMODULE_UCG
config UCG_DISPLAY_HX8352C_18X240X400
depends on NODEMCU_CMODULE_SPI
bool "hx8352c_18x240x400_hw_spi"
default "n"
config UCG_DISPLAY_ILI9163_18X128X128
depends on NODEMCU_CMODULE_SPI
bool "ili9163_18x128x128_hw_spi"
default "n"
config UCG_DISPLAY_ILI9341_18X240X320
depends on NODEMCU_CMODULE_SPI
bool "ili9341_18x240x320_hw_spi"
default "y"
config UCG_DISPLAY_ILI9486_18X320X480
depends on NODEMCU_CMODULE_SPI
bool "ili9486_18x320x480_hw_spi"
default "n"
config UCG_DISPLAY_PCF8833_16X132X132
depends on NODEMCU_CMODULE_SPI
bool "pcf8833_16x132x132_hw_spi"
default "n"
config UCG_DISPLAY_SEPS225_16X128X128_UNIVISION
depends on NODEMCU_CMODULE_SPI
bool "seps225_16x128x128_uvis_hw_spi"
default "n"
config UCG_DISPLAY_SSD1351_18X128X128_ILSOFT
depends on NODEMCU_CMODULE_SPI
bool "ssd1351_18x128x128_hw_spi"
default "n"
config UCG_DISPLAY_SSD1351_18X128X128_FT
depends on NODEMCU_CMODULE_SPI
bool "ssd1351_18x128x128_ft_hw_spi"
default "n"
config UCG_DISPLAY_SSD1331_18X96X64_UNIVISION
depends on NODEMCU_CMODULE_SPI
bool "ssd1331_18x96x64_uvis_hw_spi"
default "n"
config UCG_DISPLAY_ST7735_18X128X160
depends on NODEMCU_CMODULE_SPI
bool "st7735_18x128x160_hw_spi"
default "y"
endmenu
menu "Fonts"
depends on NODEMCU_CMODULE_UCG
config UCG_FONT_SELECTION
depends on NODEMCU_CMODULE_UCG
string "Font list"
default "font_7x13B_tr,font_helvB08_hr,font_helvB10_hr,font_helvB12_hr,font_helvB18_hr,font_ncenB24_tr,font_ncenR12_tr,font_ncenR14_hr"
help
Enter a comma-separated list of fonts.
endmenu
COMPONENT_SRCDIRS:=ucg/src/clib .
COMPONENT_ADD_INCLUDEDIRS:=ucg/src/clib
CPPFLAGS+=-DUSE_PIN_LIST
idf_build_set_property(COMPILE_OPTIONS "-DUSE_PIN_LIST" APPEND)
menu "Displays"
depends on NODEMCU_CMODULE_UCG
config UCG_DISPLAY_HX8352C_18X240X400
depends on NODEMCU_CMODULE_SPI
bool "hx8352c_18x240x400_hw_spi"
default "n"
config UCG_DISPLAY_ILI9163_18X128X128
depends on NODEMCU_CMODULE_SPI
bool "ili9163_18x128x128_hw_spi"
default "n"
config UCG_DISPLAY_ILI9341_18X240X320
depends on NODEMCU_CMODULE_SPI
bool "ili9341_18x240x320_hw_spi"
default "y"
config UCG_DISPLAY_ILI9486_18X320X480
depends on NODEMCU_CMODULE_SPI
bool "ili9486_18x320x480_hw_spi"
default "n"
config UCG_DISPLAY_PCF8833_16X132X132
depends on NODEMCU_CMODULE_SPI
bool "pcf8833_16x132x132_hw_spi"
default "n"
config UCG_DISPLAY_SEPS225_16X128X128_UNIVISION
depends on NODEMCU_CMODULE_SPI
bool "seps225_16x128x128_uvis_hw_spi"
default "n"
config UCG_DISPLAY_SSD1351_18X128X128_ILSOFT
depends on NODEMCU_CMODULE_SPI
bool "ssd1351_18x128x128_hw_spi"
default "n"
config UCG_DISPLAY_SSD1351_18X128X128_FT
depends on NODEMCU_CMODULE_SPI
bool "ssd1351_18x128x128_ft_hw_spi"
default "n"
config UCG_DISPLAY_SSD1331_18X96X64_UNIVISION
depends on NODEMCU_CMODULE_SPI
bool "ssd1331_18x96x64_uvis_hw_spi"
default "n"
config UCG_DISPLAY_ST7735_18X128X160
depends on NODEMCU_CMODULE_SPI
bool "st7735_18x128x160_hw_spi"
default "y"
endmenu
menu "Fonts"
depends on NODEMCU_CMODULE_UCG
config UCG_FONT_SELECTION
depends on NODEMCU_CMODULE_UCG
string "Font list"
default "font_7x13B_tr,font_helvB08_hr,font_helvB10_hr,font_helvB12_hr,font_helvB18_hr,font_ncenB24_tr,font_ncenR12_tr,font_ncenR14_hr"
help
Enter a comma-separated list of fonts.
endmenu
idf_component_register(
SRCS "crc32.c" "uzlib_deflate.c" "uzlib_inflate.c"
INCLUDE_DIRS "."
)
-include $(PROJECT_PATH)/build/include/config/auto.conf
COMPONENT_ADD_INCLUDEDIRS:=.
......@@ -274,19 +274,8 @@ none
## net.socket:hold()
Throttle data reception by placing a request to block the TCP receive function. This request is not effective immediately, Espressif recommends to call it while reserving 5*1460 bytes of memory.
#### Syntax
`hold()`
#### Parameters
none
#### Returns
`nil`
#### See also
[`net.socket:unhold()`](#netsocketunhold)
This call is no longer available, as the underlying functionality was
removed upstream.
## net.socket:on()
......@@ -337,13 +326,11 @@ srv:on("receive", function(sck, c)
buffer = buffer .. c
end
end)
-- throttling could be implemented using socket:hold()
-- example: https://github.com/nodemcu/nodemcu-firmware/blob/master/lua_examples/pcm/play_network.lua#L83
```
#### See also
- [`net.createServer()`](#netcreateserver)
- [`net.socket:hold()`](#netsockethold)
## net.socket:send()
......@@ -418,19 +405,8 @@ end)
## net.socket:unhold()
Unblock TCP receiving data by revocation of a preceding `hold()`.
#### Syntax
`unhold()`
#### Parameters
none
#### Returns
`nil`
#### See also
[`net.socket:hold()`](#netsockethold)
This call is no longer available as the underlying functionality was
removed upstream.
# net.udpsocket Module
......
#!/bin/bash
set -e
echo "Installing IDF prerequisites..."
IDF_DIR=./sdk/esp32-esp-idf
${IDF_DIR}/install.sh
. ${IDF_DIR}/export.sh
echo "Installing NodeMCU prerequisites..."
export PATH=${IDF_PYTHON_ENV_PATH}:${PATH}
pip install -r requirements.txt
cat << EOF
Installation of prerequisites complete.
EOF
Subproject commit b64b3752342a23469ada0188d4838a4fb96fe172
Subproject commit 8e3e65a47b7d9b5dc4f52eb56660a748fda1884e
# set custom partition table for 1.5MB firmware
# Default to 4MB for builds
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# Set custom partition table for 1.5MB firmware
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="components/platform/partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="components/platform/partitions.csv"
CONFIG_PARTITION_TABLE_SINGLE_APP=n
CONFIG_PARTITION_TABLE_TWO_OTA=n
CONFIG_PARTITION_TABLE_CUSTOM=y
# Default to 4MB for builds
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
# Don't warn about undefined variables
CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=n
# Squeeze in as much code as we can manage
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
# Empirical value to prevent a firmware crash due to stack overflow.
CONFIG_MAIN_TASK_STACK_SIZE=8192
CONFIG_ESP_MAIN_TASK_STACK_SIZE=8192
# Enable address reuse for sockets in TIME_WAIT
# see https://github.com/nodemcu/nodemcu-firmware/pull/1838
CONFIG_LWIP_SO_REUSE=y
# Enable panic handler for task wdt to reset the firmware upon wdt timeout
CONFIG_ESP_TASK_WDT_PANIC=y
# Decrease the duration of sockets in TIME_WAIT
# see https://github.com/nodemcu/nodemcu-firmware/issues/1836
CONFIG_TCP_MSL=5000
# Disable advanced features by default
CONFIG_MQTT_TRANSPORT_SSL=n
CONFIG_MQTT_TRANSPORT_WEBSOCKET=n
CONFIG_MQTT_USE_CUSTOM_CONFIG=n
# Allow writing to dangerous regions to avoid boot loops when creating filesystem
# Symptom:
# Mounting flash filesystem...
# No filesystem partition found, attempting to create it...
# abort() was called at PC 0x400ecddd on core 0
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=y
CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED=y
# Enable panic handler for task wdt to reset the firmware upon wdt timeout
CONFIG_TASK_WDT_PANIC=y
# Enable address reuse for sockets in TIME_WAIT
# see https://github.com/nodemcu/nodemcu-firmware/pull/1838
CONFIG_LWIP_SO_REUSE=y
# Disable advanced features by default
CONFIG_MQTT_TRANSPORT_SSL=n
CONFIG_MQTT_TRANSPORT_WEBSOCKET=n
CONFIG_MQTT_USE_CUSTOM_CONFIG=n
# Decrease the duration of sockets in TIME_WAIT
# see https://github.com/nodemcu/nodemcu-firmware/issues/1836
CONFIG_TCP_MSL=5000
# Disable esp-idf's bluetooth component by default.
# The bthci module is also disabled and will enable bt when selected
CONFIG_BT_ENABLED=n
# Set "Release" code optimization level for -Os
CONFIG_OPTIMIZATION_LEVEL_RELEASE=y
......@@ -2,7 +2,7 @@
LUA_APP_SRC="$@"
MAP_FILE=build/NodeMCU.map
MAP_FILE=build/nodemcu.map
LUAC_OUTPUT=build/luac.out
LUAC_CROSS=build/luac_cross/luac.cross
......@@ -15,18 +15,19 @@ if [ ! -f "${LUAC_CROSS}" ]; then
exit 1
fi
LFS_ADDR_SIZE=`grep -E "\.lfs\.reserved[ ]+0x[0-9a-f]+[ ]+0x[0-9a-z]+" ${MAP_FILE} | tr -s ' '`
LFS_ADDR_SIZE=$(grep -E "0x[0-9a-f]+[ ]+0x[0-9a-f]+[ ]+esp-idf/embedded_lfs/libembedded_lfs.a\(lua.flash.store.reserved.S.obj\)" "${MAP_FILE}" | grep -v -w 0x0 | tr -s ' ')
if [ -z "${LFS_ADDR_SIZE}" ]; then
echo "Error: LFS segment not found. Use 'make clean; make' perhaps?"
exit 1
fi
LFS_ADDR=`echo "${LFS_ADDR_SIZE}" | cut -d ' ' -f 3`
LFS_ADDR=$(echo "${LFS_ADDR_SIZE}" | cut -d ' ' -f 2)
if [ -z "${LFS_ADDR}" ]; then
echo "Error: LFS segment address not found"
exit 1
fi
LFS_SIZE=`echo "${LFS_ADDR_SIZE}" | cut -d ' ' -f 4`
# The reported size is +4 due to the length field added by the IDF
LFS_SIZE=$(( $(echo "${LFS_ADDR_SIZE}" | cut -d ' ' -f 3) - 4 ))
if [ -z "${LFS_SIZE}" ]; then
echo "Error: LFS segment size not found"
exit 1
......@@ -39,5 +40,7 @@ if [ $? != 0 ]; then
echo "Error: luac.cross failed"
exit 1
fi
# cmake depencies don't seem to pick up the change to luac.out?
rm -f build/lua.flash.store.reserved
make
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment