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

@ -16,7 +16,7 @@ impl<'a, SocketImpl: Socket> InactiveUdpSocket<'a, SocketImpl> {
pub fn activate<SpiBus: ActiveBus, NetworkImpl: Network>(self, w5500: W5500<SpiBus, NetworkImpl>) -> Result<UdpSocket<'a, SpiBus, NetworkImpl, SocketImpl>, ForeignSocketError> {
let (bus, network, sockets) = w5500.release();
if self.socket.is_owned_by(sockets) {
if self.socket.is_owned_by(&sockets) {
Ok(UdpSocket::new(bus, network, sockets, self.socket))
} else {
Err(ForeignSocketError {})