Browse Source

scripts: some more Core version fixes

Remove 2.3.0 code for ldscripts
Update
pull/2471/head
Maxim Prokhorov 2 years ago
parent
commit
a1e7941fa6
19 changed files with 17 additions and 447 deletions
  1. +4
    -4
      code/platformio.ini
  2. +1
    -15
      code/scripts/espurna_utils/ldscripts.py
  3. +0
    -39
      dist/arduino_ide/2.3.0/boards.local.txt
  4. +1
    -2
      dist/arduino_ide/README.md
  5. +7
    -4
      dist/ld/README.md
  6. +0
    -30
      dist/ld/latest/eagle.flash.1m0m1s.ld
  7. +0
    -30
      dist/ld/latest/eagle.flash.1m0m2s.ld
  8. +0
    -30
      dist/ld/latest/eagle.flash.2m1m4s.ld
  9. +0
    -30
      dist/ld/latest/eagle.flash.4m1m4s.ld
  10. +0
    -30
      dist/ld/latest/eagle.flash.4m3m4s.ld
  11. +0
    -30
      dist/ld/latest/eagle.flash.512k0m1s.ld
  12. +0
    -30
      dist/ld/pre_2.5.0/eagle.flash.1m0m1s.ld
  13. +0
    -30
      dist/ld/pre_2.5.0/eagle.flash.1m0m2s.ld
  14. +0
    -30
      dist/ld/pre_2.5.0/eagle.flash.2m1m4s.ld
  15. +0
    -30
      dist/ld/pre_2.5.0/eagle.flash.4m1m4s.ld
  16. +0
    -30
      dist/ld/pre_2.5.0/eagle.flash.4m3m4s.ld
  17. +0
    -30
      dist/ld/pre_2.5.0/eagle.flash.512k0m1s.ld
  18. +4
    -10
      dist/ldscript_gen.py
  19. +0
    -13
      dist/patches/lwip_mtu_issue_1610.patch

+ 4
- 4
code/platformio.ini View File

@ -52,19 +52,19 @@ platform_latest = espressif8266@2.6.3
# 487 KB sketch, 4 KB eeprom, 16 KB reserved, no space for ota
board_512k = esp01
ldscript_512k = eagle.flash.512k0m1s.ld
ldscript_512k = eagle.flash.512k.ld
# 999 KB sketch, 4 KB eeprom, 16 KB reserved
board_1m = esp01_1m
ldscript_1m = eagle.flash.1m0m1s.ld
ldscript_1m = eagle.flash.1m.ld
# 1019 KB sketch, 16 KB eeprom, 992 KB fs, 16 KB reserved
board_2m = esp_wroom_02
ldscript_2m = eagle.flash.2m1m4s.ld
ldscript_2m = eagle.flash.2m1m.ld
# 1019 KB sketch, 16 KB eeprom, 992 KB fs, 16 KB reserved, 2048 KB empty/ota
board_4m = esp12e
ldscript_4m = eagle.flash.4m1m4s.ld
ldscript_4m = eagle.flash.4m1m.ld
# OPTIONAL:
# 1019 KB sketch, 16 KB eeprom, 3040 KB fs, 16 KB reserved


+ 1
- 15
code/scripts/espurna_utils/ldscripts.py View File

@ -5,18 +5,4 @@ def ldscripts_inject_libpath(env):
framework_dir = platform.get_package_dir("framework-arduinoespressif8266")
libpath_base = os.path.join("$PROJECT_DIR", "..", "dist", "ld")
# we depend on different ldscript formats for old Core version
# TODO: 1.5.0 needs to be removed next release
# TODO: ldscript can be kept in the root of the repo
# (as this was done originally, during 2.3.0...2.4.2 times)
if platform.version == "1.5.0":
libpath_sdk = os.path.join(framework_dir, "tools", "sdk", "ld")
env.Append(LIBPATH=[libpath_sdk])
env.Prepend(LIBPATH=[os.path.join(libpath_base, "pre_2.5.0")])
else:
local_ld = env.subst(
os.path.join("$BUILD_DIR", "ld", "local.eagle.app.v6.common.ld")
)
env.Prepend(LIBPATH=[os.path.join(libpath_base, "latest")])
env.Prepend(LIBPATH=[libpath_base])

+ 0
- 39
dist/arduino_ide/2.3.0/boards.local.txt View File

@ -1,39 +0,0 @@
#version=2.3.0
menu.float_support=scanf and printf float support
generic.menu.FlashSize.1M1S=1M (1 EEPROM Sector, no SPIFFS)
generic.menu.FlashSize.1M1S.build.flash_size=1M
generic.menu.FlashSize.1M1S.build.flash_size_bytes=0x100000
generic.menu.FlashSize.1M1S.build.flash_ld=eagle.flash.1m0m1s.ld
generic.menu.FlashSize.1M1S.build.spiffs_pagesize=256
generic.menu.FlashSize.1M1S.upload.maximum_size=1023984
generic.menu.FlashSize.1M1S.build.rfcal_addr=0xFC000
generic.menu.FlashSize.2M4S=2M (4 EEPROM Sectors, 1M SPIFFS)
generic.menu.FlashSize.2M4S.build.flash_size=2M
generic.menu.FlashSize.2M4S.build.flash_size_bytes=0x200000
generic.menu.FlashSize.2M4S.build.flash_ld=eagle.flash.2m1m4s.ld
generic.menu.FlashSize.2M4S.build.spiffs_pagesize=256
generic.menu.FlashSize.2M4S.upload.maximum_size=1044464
generic.menu.FlashSize.2M4S.build.rfcal_addr=0x1FC000
generic.menu.FlashSize.4M1M4S=4M (4 EEPROM Sectors, 1M SPIFFS)
generic.menu.FlashSize.4M1M4S.build.flash_size=4M
generic.menu.FlashSize.4M1M4S.build.flash_size_bytes=0x400000
generic.menu.FlashSize.4M1M4S.build.flash_ld=eagle.flash.4m1m4s.ld
generic.menu.FlashSize.4M1M4S.build.spiffs_pagesize=256
generic.menu.FlashSize.4M1M4S.upload.maximum_size=1044464
generic.menu.FlashSize.4M1M4S.build.rfcal_addr=0x3FC000
generic.menu.FlashSize.4M3M4S=4M (4 EEPROM Sectors, 3M SPIFFS)
generic.menu.FlashSize.4M3M4S.build.flash_size=4M
generic.menu.FlashSize.4M3M4S.build.flash_size_bytes=0x400000
generic.menu.FlashSize.4M3M4S.build.flash_ld=eagle.flash.4m3m4s.ld
generic.menu.FlashSize.4M3M4S.build.spiffs_pagesize=256
generic.menu.FlashSize.4M3M4S.upload.maximum_size=1044464
generic.menu.FlashSize.4M3M4S.build.rfcal_addr=0x3FC000
generic.menu.float_support.disabled=Disabled (Recommended)
generic.menu.float_support.disabled.build.float=
generic.menu.float_support.enabled=Enabled
generic.menu.float_support.enabled.build.float=-u _printf_float -u _scanf_float
generic.compiler.cpp.extra_flags=-DNO_GLOBAL_EEPROM -DMQTT_MAX_PACKET_SIZE=1024

+ 1
- 2
dist/arduino_ide/README.md View File

@ -13,8 +13,7 @@ Place boards.local.txt into Arduino hardware directory, in the same directory as
- macOS (boards manager): `~/Library/Arduino15/packages/esp2866/hardware/esp8266/<version>`
- macOS (git): `<application-directory>/Arduino.app/Contents/Java/hardware/esp8266com/esp8266`
Use `2.3.0/boards.local.txt` for Core version 2.3.0
Use `latest/boards.local.txt` for all the others
Use `latest/boards.local.txt` for Cores 2.7.4+
### Arduino documentation


+ 7
- 4
dist/ld/README.md View File

@ -1,8 +1,11 @@
# ESP8266 linker scripts with additional EEPROM sectors
# ESP8266 linker scripts override
### Installation
### PlatformIO
Depending on ESP8266 version, use files from either `Pre 2.5.0` or `latest`
Reference [../arduino_ide/README.md](../arduino_ide/README.md) about ESP8266 package location
Detected automatically, no extra steps required.
### Arduino IDE
Reference [../arduino\_ide/README.md](../arduino_ide/README.md) about ESP8266 package location
Copy all \*.ld files into the `<esp8266-package>/tools/sdk/ld` directory

+ 0
- 30
dist/ld/latest/eagle.flash.1m0m1s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 999KB
fs: 0KB
eeprom: 4KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xf9ff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x402fb000 );
PROVIDE ( _SPIFFS_end = 0x402fb000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "local.eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/latest/eagle.flash.1m0m2s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 995KB
fs: 0KB
eeprom: 8KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xf8ff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x402fa000 );
PROVIDE ( _SPIFFS_end = 0x402fa000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "local.eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/latest/eagle.flash.2m1m4s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 1019KB
fs: 992KB
eeprom: 16KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x403f8000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "local.eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/latest/eagle.flash.4m1m4s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 1019KB
fs: 992KB
eeprom: 16KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x40500000 );
PROVIDE ( _SPIFFS_end = 0x405f8000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "local.eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/latest/eagle.flash.4m3m4s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 1019KB
fs: 3040KB
eeprom: 16KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x405f8000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "local.eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/latest/eagle.flash.512k0m1s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 487KB
fs: 0KB
eeprom: 4KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0x79ff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x4027b000 );
PROVIDE ( _SPIFFS_end = 0x4027b000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "local.eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/pre_2.5.0/eagle.flash.1m0m1s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 999KB
fs: 0KB
eeprom: 4KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xf9ff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x402fb000 );
PROVIDE ( _SPIFFS_end = 0x402fb000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/pre_2.5.0/eagle.flash.1m0m2s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 995KB
fs: 0KB
eeprom: 8KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xf8ff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x402fa000 );
PROVIDE ( _SPIFFS_end = 0x402fa000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/pre_2.5.0/eagle.flash.2m1m4s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 1019KB
fs: 992KB
eeprom: 16KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x403f8000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/pre_2.5.0/eagle.flash.4m1m4s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 1019KB
fs: 992KB
eeprom: 16KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x40500000 );
PROVIDE ( _SPIFFS_end = 0x405f8000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/pre_2.5.0/eagle.flash.4m3m4s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 1019KB
fs: 3040KB
eeprom: 16KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0xfeff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x405f8000 );
PROVIDE ( _SPIFFS_page = 0x100 );
PROVIDE ( _SPIFFS_block = 0x2000 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "eagle.app.v6.common.ld"

+ 0
- 30
dist/ld/pre_2.5.0/eagle.flash.512k0m1s.ld View File

@ -1,30 +0,0 @@
/*
sketch: 487KB
fs: 0KB
eeprom: 4KB
*/
MEMORY
{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = 0x79ff0
}
/*
Provide both _SPIFFS_ and _FS_ to be compatible with 2.3.0...2.6.0+ and
any library that is using old _SPIFFS_...
*/
PROVIDE ( _SPIFFS_start = 0x4027b000 );
PROVIDE ( _SPIFFS_end = 0x4027b000 );
PROVIDE ( _SPIFFS_page = 0x0 );
PROVIDE ( _SPIFFS_block = 0x0 );
PROVIDE ( _FS_start = _SPIFFS_start );
PROVIDE ( _FS_end = _SPIFFS_end );
PROVIDE ( _FS_page = _SPIFFS_page );
PROVIDE ( _FS_block = _SPIFFS_block );
INCLUDE "eagle.app.v6.common.ld"

+ 4
- 10
dist/ldscript_gen.py View File

@ -71,7 +71,6 @@ MEMORY
{{
dport0_0_seg : org = 0x3FF00000, len = 0x10
dram0_0_seg : org = 0x3FFE8000, len = 0x14000
iram1_0_seg : org = 0x40100000, len = 0x8000
irom0_0_seg : org = 0x40201010, len = {size:#x}
}}
@ -137,28 +136,24 @@ def flash_map(flashsize, fs, sectors):
return result
def render(variant, legacy):
def render(variant):
name = variant_name(variant)
name = "eagle.flash.{}.ld".format(name)
ld_include = "local.eagle.app.v6.common.ld"
ld_dir = "ld/latest"
if legacy:
ld_include = "eagle.app.v6.common.ld"
ld_dir = "ld/pre_2.5.0"
path = os.path.join(ld_dir, name)
log.info("render %s (INCLUDE %s)", name, ld_include)
with open(path, "w") as f:
with open(path, "w", newline="\n") as f:
f.write(TEMPLATE.format(include=ld_include, **flash_map(*variant)))
def render_all():
for variant in VARIANTS:
render(variant, True)
render(variant, False)
render(variant)
if __name__ == "__main__":
@ -167,7 +162,6 @@ if __name__ == "__main__":
choices.extend(variants.keys())
parser = argparse.ArgumentParser()
parser.add_argument("--legacy", action="store_true", default=False)
parser.add_argument("--verbose", action="store_true", default=False)
parser.add_argument("variant", choices=choices)
@ -178,4 +172,4 @@ if __name__ == "__main__":
if args.variant == "all":
render_all()
else:
render(variants[args.variant], args.legacy)
render(variants[args.variant])

+ 0
- 13
dist/patches/lwip_mtu_issue_1610.patch View File

@ -1,13 +0,0 @@
diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c
index fa8d77f..a7b0595 100644
--- a/src/core/tcp_out.c
+++ b/src/core/tcp_out.c
@@ -469,7 +469,7 @@ tcp_write(struct tcp_pcb *pcb, const void *arg, u16_t len, u8_t apiflags)
if (oversize > 0) {
LWIP_ASSERT("inconsistent oversize vs. space", oversize_used <= space);
seg = last_unsent;
- oversize_used = oversize < len ? oversize : len;
+ oversize_used = LWIP_MIN(space, LWIP_MIN(oversize, len));
pos += oversize_used;
oversize -= oversize_used;
space -= oversize_used;

Loading…
Cancel
Save