aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorIan McIntyre <ianpmcintyre@gmail.com>2023-12-15 12:20:53 -0500
committerIan McIntyre <ianpmcintyre@gmail.com>2023-12-15 12:25:09 -0500
commitd2bee58caa082ed476d5b1d8bda39992df29fd07 (patch)
treef73cc3ac21d210ad1979b77e1b8f1fbd8de0ee3c /src/lib.rs
parentc7e5123f6604fbb9ca510f01af9b60e777bf57b4 (diff)
Fix debug assert in ENET initialization
Wrong way to check for the ignored four low bits.
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs2
1 files changed, 1 insertions, 1 deletions
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<const N: u8> Enet<N> {
// 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.