From fd6d254d5293fd7b3bdd52d5d949597958e99741 Mon Sep 17 00:00:00 2001 From: Peter Hartley Date: Mon, 15 Apr 2024 12:10:12 +0100 Subject: [PATCH] Add CHANGELOG entry and fix review comments --- CHANGELOG.md | 1 + src/raw_device.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 010d5dd..7df0d22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed an issue where internal function names were conflicting with trait names by [@ryan-summers](https://github.com/ryan-summers) ([#36](https://github.com/kellerkindt/w5500/issues/36)) - Add `RetryTime` and `RetryCount` common register methods to `Device` and `UninitializedDevice` by [@elpiel](https://github.com/elpiel) ([#54][PR54]) - Add `Udp::get_port` and `Udp::set_port` by [@elpiel](https://github.com/elpiel) ([#57](https://github.com/kellerkindt/w5500/pull/57)) +- Add `RawDevice::enable_interrupts` (and `clear_interrupts`, `disable_interrupts`) for interrupt-driven MACRAW mode by [@pdh11](https://github.com/pdh11) ([#60](https://github.com/kellerkindt/w5000/pull/60)) ### Fixed diff --git a/src/raw_device.rs b/src/raw_device.rs index c9e1224..e9cec64 100644 --- a/src/raw_device.rs +++ b/src/raw_device.rs @@ -46,7 +46,7 @@ impl RawDevice { /// For instance, pass `Interrupt::Receive` to get interrupts /// on packet reception only. /// - pub fn enable_interrupt(&mut self, which: u8) -> Result<(), SpiBus::Error> { + pub fn enable_interrupts(&mut self, which: u8) -> Result<(), SpiBus::Error> { self.raw_socket.set_interrupt_mask(&mut self.bus, which)?; self.bus.write_frame( register::COMMON, @@ -64,14 +64,14 @@ impl RawDevice { /// can mask the interrupt *at microcontroller level* in the /// interrupt handler, then call this from thread mode before /// unmasking again. - pub fn clear_interrupt(&mut self) -> Result<(), SpiBus::Error> { + pub fn clear_interrupts(&mut self) -> Result<(), SpiBus::Error> { self.raw_socket .reset_interrupt(&mut self.bus, register::socketn::Interrupt::All) } /// Disable all interrupts /// - pub fn disable_interrupt(&mut self) -> Result<(), SpiBus::Error> { + pub fn disable_interrupts(&mut self) -> Result<(), SpiBus::Error> { self.bus.write_frame( register::COMMON, register::common::SOCKET_INTERRUPT_MASK,