-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable hardware interrupts #34
base: master
Are you sure you want to change the base?
Conversation
Hello @Wassasin, thank you for this fix. I was wondering if you could give a quick overview of how this interrupt could be used? |
It has been a while since opening this PR, so please check anything I write here yourself. This pull request only fixes the interrupt related to already opened sockets. WOL is a mechanism implemented by the W5500 separately as part of the Mode Register, and works without opening any socket for any WOL packet received on any UDP port. Check the datasheet for when the W5500 asserts the intn-pin. You would only have to create a new PR that:
|
@@ -37,7 +37,9 @@ impl TcpSocket { | |||
|
|||
self.socket.set_interrupt_mask( | |||
bus, | |||
socketn::Interrupt::SendOk as u8 & socketn::Interrupt::Timeout as u8, | |||
socketn::Interrupt::SendOk as u8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like interrupts should be configured when creating the socket. We don't want to blindly enable them for everything in my opinion
self.bus.write_frame( | ||
register::COMMON, | ||
register::common::SOCKET_INTERRUPT_MASK, | ||
&[0xFF], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should get this as configurable data. People may have cases where they do not want the INTn line changing
I noticed no hardware interrupts being triggered on pin
INTn
. Fixed by:&
to bitwise OR|
.I am unsure whether enabling the hardware interrupts in the device initialization is the best location to do so, or whether it is better to fetch the current mask when using a specific socket and enabling interrupts only for the new socket.