Moved register addresses into register modules, fixed borrow error

This commit is contained in:
Jonah Dahlquist 2019-09-05 13:21:25 -05:00 committed by Jonah Dahlquist
commit 65a9552816
4 changed files with 86 additions and 37 deletions

View file

@ -51,10 +51,10 @@ impl<SpiBus: ActiveBus, NetworkImpl: Network> W5500<SpiBus, NetworkImpl> {
}
pub fn open_udp_socket<'a, SocketImpl: Socket>(
&self,
self,
socket: &'a mut SocketImpl,
) -> Result<UdpSocket<'a, SpiBus, NetworkImpl, SocketImpl>, ForeignSocketError> {
if socket.is_owned_by(self.sockets) {
if socket.is_owned_by(&self.sockets) {
Ok(UdpSocket::new(self.bus, self.network, self.sockets, socket))
} else {
Err(ForeignSocketError {})