Skip to content

Commit c968857

Browse files
committed
ppi: add clear_fork_task_endpoint
1 parent 2755bf3 commit c968857

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

nrf-hal-common/src/ppi/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ pub trait Ppi: PpiSealed {
8282
/// Sets the fork task that must be triggered when the configured event occurs. The user must
8383
/// provide a reference to the task.
8484
fn set_fork_task_endpoint<T: Task>(&mut self, task: &T);
85+
86+
#[cfg(not(feature = "51"))]
87+
/// Clear the fork task endpoint. Previously set task will no longer be triggered.
88+
fn clear_fork_task_endpoint(&mut self);
8589
}
8690

8791
/// Traits that extends the [Ppi](trait.Ppi.html) trait, marking a channel as fully configurable.
@@ -133,6 +137,15 @@ impl<P: Channel> Ppi for P {
133137
.tep
134138
.write(|w| unsafe { w.bits(task.task_addr().0) });
135139
}
140+
141+
#[cfg(not(feature = "51"))]
142+
#[inline(always)]
143+
fn clear_fork_task_endpoint(&mut self) {
144+
let regs = unsafe { &*PPI::ptr() };
145+
regs.fork[P::CH]
146+
.tep
147+
.write(|w| unsafe { w.bits(0) });
148+
}
136149
}
137150

138151
// All unsafe `ptr` calls only uses registers atomically, and only changes the resources owned by

0 commit comments

Comments
 (0)