Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF) (#15250)

* Changes for FreeRTOS/LwIP Port for the ESP32 (ESP-IDF)

Adding FreeRTOS/LwIP to compiler:

* adding freertos option
* dyncalls for freertos
* add freertos to posix os list
* adding lwip option

Setting up networking FreeRTOS/LwIP Port:

* setting up lwip network for freertos
* fixing posix / networking for freertos
* disable setInheritable for freerots
* using lwip for net control items

* Fix builds by ignoring lib/posix/posix_freertos_consts.nim similar to lib/posix/posix_other_consts.nim
This commit is contained in:
Jaremy Creechley 2020-08-31 03:48:54 -06:00 • committed by GitHub
commit a76ae8f795
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 589 additions and 32 deletions

View file

@ -962,9 +962,15 @@ proc IN6_IS_ADDR_LINKLOCAL* (a1: ptr In6Addr): cint {.
proc IN6_IS_ADDR_SITELOCAL* (a1: ptr In6Addr): cint {.
importc, header: "<netinet/in.h>".}
## Unicast site-local address.
proc IN6_IS_ADDR_V4MAPPED* (a1: ptr In6Addr): cint {.
importc, header: "<netinet/in.h>".}
## IPv4 mapped address.
when defined(lwip):
proc IN6_IS_ADDR_V4MAPPED*(ipv6_address: ptr In6Addr): cint =
var bits32: ptr array[4, uint32] = cast[ptr array[4, uint32]](ipv6_address)
return (bits32[1] == 0'u32 and bits32[2] == htonl(0x0000FFFF)).cint
else:
proc IN6_IS_ADDR_V4MAPPED* (a1: ptr In6Addr): cint {.
importc, header: "<netinet/in.h>".}
## IPv4 mapped address.
proc IN6_IS_ADDR_V4COMPAT* (a1: ptr In6Addr): cint {.
importc, header: "<netinet/in.h>".}
## IPv4-compatible address.
@ -1026,8 +1032,9 @@ proc setnetent*(a1: cint) {.importc, header: "<netdb.h>".}
proc setprotoent*(a1: cint) {.importc, header: "<netdb.h>".}
proc setservent*(a1: cint) {.importc, header: "<netdb.h>".}
proc poll*(a1: ptr TPollfd, a2: Tnfds, a3: int): cint {.
importc, header: "<poll.h>", sideEffect.}
when not defined(lwip):
proc poll*(a1: ptr TPollfd, a2: Tnfds, a3: int): cint {.
importc, header: "<poll.h>", sideEffect.}
proc realpath*(name, resolved: cstring): cstring {.
importc: "realpath", header: "<stdlib.h>".}