Skip to content

Commit 0803fc5

Browse files
committed
w5200: Allow selecting maximum fixed buffer size for MACRAW.
Enabling WIZCHIP_USE_MAX_BUFFER will make the TX/RX buffers the maximum available size, for use with MACRAW mode. Adapted from original version by @dpgeorge at: micropython/micropython@cd9de63
1 parent 0fb14c8 commit 0803fc5

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Ethernet/W5200/w5200.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@
4141
#include "w5200.h"
4242

4343
#if (_WIZCHIP_ == 5200)
44+
45+
#if WIZCHIP_USE_MAX_BUFFER
46+
// This option is intended to be used when MACRAW mode is enabled, to allow
47+
// the single raw socket to use all the available buffer space.
48+
#undef getSn_TxMASK
49+
#define getSn_TxMASK(sn) (16 * 1024 - 1) /* tx buffer mask */
50+
51+
#undef getSn_TxMAX
52+
#define getSn_TxMAX(sn) (16 * 1024) /* max tx buffer size */
53+
54+
#undef getSn_RxMASK
55+
#define getSn_RxMASK(sn) (16 * 1024 - 1) /* rx buffer mask */
56+
57+
#undef getSn_RxMAX
58+
#define getSn_RxMAX(sn) (16 * 1024) /* max rx buffer size */
59+
#endif
60+
4461
/**
4562
@brief This function writes the data into W5200 registers.
4663
*/

0 commit comments

Comments
 (0)