Skip to content

Commit 71aab30

Browse files
committed
Merge branch 'master' of https://github.com/nrf-rs/nrf-hal
2 parents 2d8930b + 2755bf3 commit 71aab30

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

nrf-hal-common/src/gpiote.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,23 +221,21 @@ impl<'a, P: GpioteInputPin> GpioteChannelEvent<'_, P> {
221221
config_channel_event_pin(self.gpiote, self.channel, self.pin, EventPolarity::None);
222222
self
223223
}
224-
225-
/// Enables GPIOTE interrupt for pin.
224+
/// Enables GPIOTE interrupt for channel.
226225
pub fn enable_interrupt(&self) -> &Self {
227226
unsafe {
228227
self.gpiote
229228
.intenset
230-
.modify(|r, w| w.bits(r.bits() | self.pin.pin() as u32))
229+
.write(|w| w.bits(1 << self.channel))
231230
}
232231
self
233232
}
234-
235-
/// Disables GPIOTE interrupt for pin.
233+
/// Disables GPIOTE interrupt for channel.
236234
pub fn disable_interrupt(&self) -> &Self {
237235
unsafe {
238236
self.gpiote
239237
.intenclr
240-
.write(|w| w.bits(self.pin.pin() as u32))
238+
.write(|w| w.bits(1 << self.channel))
241239
}
242240
self
243241
}

nrf-hal-common/src/uarte.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ where
260260
// This is overly restrictive. See (similar SPIM issue):
261261
// https://github.com/nrf-rs/nrf52/issues/17
262262
if rx_buffer.len() > u8::max_value() as usize {
263-
return Err(Error::TxBufferTooLong);
263+
return Err(Error::RxBufferTooLong);
264264
}
265265

266266
// NOTE: RAM slice check is not necessary, as a mutable slice can only be

0 commit comments

Comments
 (0)