lwipopts.h 995 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H
  2. #define MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H
  3. #include <py/mpconfig.h>
  4. #include <py/misc.h>
  5. #include <py/mphal.h>
  6. // We're running without an OS for this port. We don't provide any services except light protection.
  7. #define NO_SYS 1
  8. #define SYS_LIGHTWEIGHT_PROT 1
  9. #include <stdint.h>
  10. typedef uint32_t sys_prot_t;
  11. #define TCP_LISTEN_BACKLOG 1
  12. // We'll put these into a proper ifdef once somebody implements an ethernet driver
  13. #define LWIP_ARP 0
  14. #define LWIP_ETHERNET 0
  15. #define LWIP_DNS 1
  16. #define LWIP_NETCONN 0
  17. #define LWIP_SOCKET 0
  18. #ifdef MICROPY_PY_LWIP_SLIP
  19. #define LWIP_HAVE_SLIPIF 1
  20. #endif
  21. // For now, we can simply define this as a macro for the timer code. But this function isn't
  22. // universal and other ports will need to do something else. It may be necessary to move
  23. // things like this into a port-provided header file.
  24. #define sys_now mp_hal_ticks_ms
  25. #endif // MICROPY_INCLUDED_EXTMOD_LWIP_INCLUDE_LWIPOPTS_H