summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2024-08-28 16:59:42 +1000
committerDamien George <damien@micropython.org>2024-08-29 23:47:55 +1000
commit851aa06461fb5b25e52329021ccaa11008c0f77a (patch)
tree6329aca0cc0864e8d2a4f1445d8950eb3abbfaea
parentaee002dd80ad8829ae247950f784b1f145fb822e (diff)
rp2: Integrate optional network.PPP.
Can be enabled by a board by enabling `MICROPY_PY_NETWORK_PPP_LWIP`. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--ports/rp2/lwip_inc/lwipopts.h11
-rw-r--r--ports/rp2/mpconfigport.h1
2 files changed, 11 insertions, 1 deletions
diff --git a/ports/rp2/lwip_inc/lwipopts.h b/ports/rp2/lwip_inc/lwipopts.h
index 5f37ecdac..f42bea528 100644
--- a/ports/rp2/lwip_inc/lwipopts.h
+++ b/ports/rp2/lwip_inc/lwipopts.h
@@ -1,7 +1,7 @@
#ifndef MICROPY_INCLUDED_RP2_LWIP_LWIPOPTS_H
#define MICROPY_INCLUDED_RP2_LWIP_LWIPOPTS_H
-#include <stdint.h>
+#include "py/mpconfig.h"
// This protection is not needed, instead protect lwIP code with flags
#define SYS_ARCH_DECL_PROTECT(lev) do { } while (0)
@@ -38,6 +38,12 @@
#define LWIP_MDNS_RESPONDER 1
#define LWIP_IGMP 1
+#if MICROPY_PY_LWIP_PPP
+#define PPP_SUPPORT 1
+#define PAP_SUPPORT 1
+#define CHAP_SUPPORT 1
+#endif
+
#define LWIP_NUM_NETIF_CLIENT_DATA LWIP_MDNS_RESPONDER
#define MEMP_NUM_UDP_PCB (4 + LWIP_MDNS_RESPONDER)
#define MEMP_NUM_SYS_TIMEOUT (LWIP_NUM_SYS_TIMEOUT_INTERNAL + LWIP_MDNS_RESPONDER)
@@ -57,4 +63,7 @@ extern uint32_t rosc_random_u32(void);
typedef uint32_t sys_prot_t;
+// Needed for PPP.
+#define sys_jiffies sys_now
+
#endif // MICROPY_INCLUDED_RP2_LWIP_LWIPOPTS_H
diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h
index a428721d7..49acafe23 100644
--- a/ports/rp2/mpconfigport.h
+++ b/ports/rp2/mpconfigport.h
@@ -155,6 +155,7 @@
#define MICROPY_VFS_LFS2 (1)
#define MICROPY_VFS_FAT (1)
#define MICROPY_SSL_MBEDTLS (1)
+#define MICROPY_PY_LWIP_PPP (MICROPY_PY_NETWORK_PPP_LWIP)
#define MICROPY_PY_LWIP_SOCK_RAW (MICROPY_PY_LWIP)
// Hardware timer alarm index. Available range 0-3.