diff --git a/src/net/net.rs b/src/net/net.rs index b6b3e17..22233f3 100644 --- a/src/net/net.rs +++ b/src/net/net.rs @@ -246,14 +246,16 @@ impl ServerHandle { pub fn send(&mut self, buffer: &mut [u8], num_bytes: usize, socket_handles: SocketHandle) { let socket = self.socket_set.get_mut::(socket_handles); if num_bytes > 0 { - match socket.send_slice(&buffer[..num_bytes]) { - Ok(_) => { - info!("Enqueued {} bytes.", num_bytes); - } - Err(err) => { - info!("Bytes cannot be sent. Error: {:?}", err) - } - }; + cortex_m::interrupt::free(|_| { + match socket.send_slice(&buffer[..num_bytes]) { + Ok(_) => { + info!("Enqueued {} bytes.", num_bytes); + } + Err(err) => { + info!("Bytes cannot be sent. Error: {:?}", err) + } + }; + }); } }