Skip to content

Commit

Permalink
Fix converting HPTW value to address (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
agerasev committed Jun 2, 2024
1 parent f6e0a96 commit 9dd4c26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions freertos-rust/src/isr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ impl InterruptContext {
}
}

pub fn get_task_field_mut(&self) -> FreeRtosBaseTypeMutPtr {
self.x_higher_priority_task_woken as *mut _
pub fn get_task_field_mut(&mut self) -> FreeRtosBaseTypeMutPtr {
&mut self.x_higher_priority_task_woken as *mut _
}
pub fn higher_priority_task_woken(&self) -> FreeRtosBaseType {
self.x_higher_priority_task_woken
}
}

Expand Down
2 changes: 1 addition & 1 deletion freertos-rust/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ impl Task {
/// Notify this task from an interrupt.
pub fn notify_from_isr(
&self,
context: &InterruptContext,
context: &mut InterruptContext,
notification: TaskNotification,
) -> Result<(), FreeRtosError> {
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion freertos-rust/src/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ impl Timer {
}

/// Start the timer from an interrupt.
pub fn start_from_isr(&self, context: &InterruptContext) -> Result<(), FreeRtosError> {
pub fn start_from_isr(&self, context: &mut InterruptContext) -> Result<(), FreeRtosError> {
unsafe {
if freertos_rs_timer_start_from_isr(self.handle, context.get_task_field_mut()) == 0 {
Ok(())
Expand Down

0 comments on commit 9dd4c26

Please sign in to comment.