alif: Integrate lwIP and mbedTLS.

Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
Damien George
2024-10-14 21:48:51 +11:00
parent 411146b0ed
commit 526c7eabce
12 changed files with 320 additions and 1 deletions

View File

@@ -30,6 +30,7 @@
#include "py/mperrno.h"
#include "py/mphal.h"
#include "py/stackctrl.h"
#include "extmod/modnetwork.h"
#include "shared/readline/readline.h"
#include "shared/runtime/gchelper.h"
#include "shared/runtime/pyexec.h"
@@ -42,6 +43,11 @@
#include "se_services.h"
#include "system_tick.h"
#if MICROPY_PY_LWIP
#include "lwip/init.h"
#include "lwip/apps/mdns.h"
#endif
extern uint8_t __StackTop, __StackLimit;
extern uint8_t __GcHeapStart, __GcHeapEnd;
@@ -83,6 +89,17 @@ int main(void) {
mp_stack_set_limit(&__StackTop - &__StackLimit - 1024);
gc_init(&__GcHeapStart, &__GcHeapEnd);
#if MICROPY_PY_LWIP
// lwIP doesn't allow to reinitialise itself by subsequent calls to this function
// because the system timeout list (next_timeout) is only ever reset by BSS clearing.
// So for now we only init the lwIP stack once on power-up.
lwip_init();
#if LWIP_MDNS_RESPONDER
mdns_resp_init();
#endif
mod_network_lwip_init();
#endif
for (;;) {
// Initialise MicroPython runtime.
mp_init();