Skip to content

Commit 9dd4c26

Browse files
authored
Fix converting HPTW value to address (#70)
1 parent f6e0a96 commit 9dd4c26

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

freertos-rust/src/isr.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ impl InterruptContext {
1717
}
1818
}
1919

20-
pub fn get_task_field_mut(&self) -> FreeRtosBaseTypeMutPtr {
21-
self.x_higher_priority_task_woken as *mut _
20+
pub fn get_task_field_mut(&mut self) -> FreeRtosBaseTypeMutPtr {
21+
&mut self.x_higher_priority_task_woken as *mut _
22+
}
23+
pub fn higher_priority_task_woken(&self) -> FreeRtosBaseType {
24+
self.x_higher_priority_task_woken
2225
}
2326
}
2427

freertos-rust/src/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl Task {
241241
/// Notify this task from an interrupt.
242242
pub fn notify_from_isr(
243243
&self,
244-
context: &InterruptContext,
244+
context: &mut InterruptContext,
245245
notification: TaskNotification,
246246
) -> Result<(), FreeRtosError> {
247247
unsafe {

freertos-rust/src/timers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl Timer {
157157
}
158158

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

0 commit comments

Comments
 (0)