Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions examples/espressif/esp/src/lwip/exports.zig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ export fn lwip_unlock_core_mutex() void {
core_mutex.unlock();
}

export fn lwip_assert_core_locked() void {
if (c.lock_tcpip_core == null) return;

const mutex: *rtos.Mutex = @ptrCast(@alignCast(c.lock_tcpip_core));
std.debug.assert(mutex.locked != null);
}

export fn lwip_rand() u32 {
return esp.rng.random_u32();
}
Expand Down
3 changes: 3 additions & 0 deletions examples/espressif/esp/src/lwip/include/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ typedef unsigned int sys_prot_t;
extern uint32_t lwip_rand(void);
extern void lwip_lock_core_mutex();
extern void lwip_unlock_core_mutex();
extern void lwip_assert_core_locked();
extern void lwip_assert(const char *msg, const char *file, int line);
extern void lwip_diag(const char *msg, const char *file, int line);

#define LWIP_ASSERT_CORE_LOCKED() do { lwip_assert_core_locked(); } while (0)

#define LWIP_PLATFORM_DIAG(x) \
do { \
lwip_diag((msg), __FILE__, __LINE__); \
Expand Down
1 change: 1 addition & 0 deletions modules/lwip/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const files = [_][]const u8{
"core/ipv4/ip4_addr.c",
"core/ipv4/igmp.c",
"core/ipv4/icmp.c",
"core/ipv4/acd.c",

// IPv6 implementation:
"core/ipv6/icmp6.c",
Expand Down
6 changes: 3 additions & 3 deletions modules/lwip/build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
},
.dependencies = .{
.lwip = .{
//.url = "https://download.savannah.nongnu.org/releases/lwip/lwip-2.1.3.zip",
.url = "https://github.com/Ashet-Technologies/deps/raw/refs/heads/main/lwip-2.1.3.zip",
.hash = "N-V-__8AAKCP6ADEah-rtpC4uEsB_-GFFCqsNInUAJY7bH3S",
// .url = "https://download.savannah.nongnu.org/releases/lwip/lwip-2.2.1.zip",
.url = "https://github.com/lwip-tcpip/lwip/archive/refs/tags/STABLE-2_2_1_RELEASE.zip",
.hash = "N-V-__8AAGSTdQCcOKeNITCRoYez502saFXZqz4ucBJ4xTa9",
},
},
}