From d2bee58caa082ed476d5b1d8bda39992df29fd07 Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Fri, 15 Dec 2023 12:20:53 -0500 Subject: Fix debug assert in ENET initialization Wrong way to check for the ignored four low bits. --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 816d944..895288c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,7 +67,7 @@ impl Enet { // The user's buffer needs to be a non-zero multiple of 16 to account for // those extra bytes. We double-check this by asserting the requirement at // compile time in the IoBuffer types. - debug_assert!(rx_ring.mtu() != 0 && rx_ring.mtu() & 0xF == rx_ring.mtu()); + debug_assert!(rx_ring.mtu() != 0 && rx_ring.mtu() & 0xF == 0); ral::write_reg!(ral::enet, enet, MRBR, R_BUF_SIZE: (rx_ring.mtu() >> 4) as u32); // Descriptor rings are pre-configured when the user acquires the slices. -- cgit v1.2.3