lwipopts.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef MICROPY_INCLUDED_STM32_LWIP_LWIPOPTS_H
  2. #define MICROPY_INCLUDED_STM32_LWIP_LWIPOPTS_H
  3. #include <stdint.h>
  4. #define NO_SYS 1
  5. #define SYS_LIGHTWEIGHT_PROT 1
  6. #define MEM_ALIGNMENT 4
  7. #define LWIP_CHKSUM_ALGORITHM 3
  8. #define LWIP_ARP 1
  9. #define LWIP_ETHERNET 1
  10. #define LWIP_NETCONN 0
  11. #define LWIP_SOCKET 0
  12. #define LWIP_STATS 0
  13. #define LWIP_NETIF_HOSTNAME 1
  14. #define LWIP_IPV6 0
  15. #define LWIP_DHCP 1
  16. #define LWIP_DHCP_CHECK_LINK_UP 1
  17. #define LWIP_DNS 1
  18. #define LWIP_IGMP 1
  19. #define SO_REUSE 1
  20. extern uint32_t rng_get(void);
  21. #define LWIP_RAND() rng_get()
  22. // default
  23. // lwip takes 15800 bytes; TCP d/l: 380k/s local, 7.2k/s remote
  24. // TCP u/l is very slow
  25. #if 0
  26. // lwip takes 19159 bytes; TCP d/l and u/l are around 320k/s on local network
  27. #define MEM_SIZE (5000)
  28. #define TCP_WND (4 * TCP_MSS)
  29. #define TCP_SND_BUF (4 * TCP_MSS)
  30. #endif
  31. #if 1
  32. // lwip takes 26700 bytes; TCP dl/ul are around 750/600 k/s on local network
  33. #define MEM_SIZE (8000)
  34. #define TCP_MSS (800)
  35. #define TCP_WND (8 * TCP_MSS)
  36. #define TCP_SND_BUF (8 * TCP_MSS)
  37. #define MEMP_NUM_TCP_SEG (32)
  38. #endif
  39. #if 0
  40. // lwip takes 45600 bytes; TCP dl/ul are around 1200/1000 k/s on local network
  41. #define MEM_SIZE (16000)
  42. #define TCP_MSS (1460)
  43. #define TCP_WND (8 * TCP_MSS)
  44. #define TCP_SND_BUF (8 * TCP_MSS)
  45. #define MEMP_NUM_TCP_SEG (32)
  46. #endif
  47. typedef uint32_t sys_prot_t;
  48. #endif // MICROPY_INCLUDED_STM32_LWIP_LWIPOPTS_H