summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJared Hancock <jared.hancock@centeredsolutions.com>2024-04-01 09:10:49 -0500
committerDamien George <damien@micropython.org>2024-05-07 17:42:34 +1000
commit8762fe8b4c6a7608d48daa8458e6501fafd3eafc (patch)
tree5cb6f344783bd74db36824aa47f4b1381a05c870
parent63c30a2dfc3118f2f82693dd96114b1efebf071c (diff)
extmod/network_wiznet5k: Properly enable socket buffers for W5100(S).
The W5100 and W5100S only have 4 available sockets and 16kB of socket buffer. Allocating 16kB to either the receive or transmit buffer of a single socket is not allowed, so the current setup does not change the allocation for socket 0 from the reset default. ctlwizchip is returning -1 to indicate the error, but the response isn't being inspected and probably doesn't need to be. Signed-off-by: Jared Hancock <jared@greezybacon.me>
-rw-r--r--extmod/network_wiznet5k.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/extmod/network_wiznet5k.c b/extmod/network_wiznet5k.c
index b8ca075b3..1eaabe9eb 100644
--- a/extmod/network_wiznet5k.c
+++ b/extmod/network_wiznet5k.c
@@ -211,7 +211,11 @@ static void wiznet5k_init(void) {
// Configure wiznet for raw ethernet frame usage.
// Configure 16k buffers for fast MACRAW
+ #if _WIZCHIP_ < W5200
+ uint8_t sn_size[8] = {8, 0, 0, 0, 8, 0, 0, 0};
+ #else
uint8_t sn_size[16] = {16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0};
+ #endif
ctlwizchip(CW_INIT_WIZCHIP, sn_size);
if (wiznet5k_obj.use_interrupt) {