This commit is contained in:
Cameron 2023-06-29 17:44:46 +02:00
parent e90f47aba3
commit 3f19879f41

View File

@ -138,8 +138,8 @@ impl Task {
} }
/// Triggers this task. /// Triggers this task.
pub unsafe fn trigger(&mut self) { pub fn trigger(&mut self) {
*self.0.as_ptr() = 1; unsafe { self.0.as_ptr().write_volatile(1) };
} }
pub(crate) fn from_reg<T>(reg: &T) -> Self { pub(crate) fn from_reg<T>(reg: &T) -> Self {
@ -179,13 +179,13 @@ impl Event {
} }
/// Describes whether this Event is currently in a triggered state. /// Describes whether this Event is currently in a triggered state.
pub unsafe fn is_triggered(&self) -> bool { pub fn is_triggered(&self) -> bool {
*self.0.as_ptr() == 1 unsafe { self.0.as_ptr().read_volatile() == 1 }
} }
/// Clear the current register's triggered state, reverting it to 0. /// Clear the current register's triggered state, reverting it to 0.
pub unsafe fn clear(&mut self) { pub fn clear(&mut self) {
*self.0.as_ptr() = 0; unsafe { self.0.as_ptr().write_volatile(0) };
} }
/// Address of publish register for this event. /// Address of publish register for this event.