Skip to content

Commit

Permalink
Move take_notification to CurrentTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus authored and niondir committed Sep 16, 2022
1 parent af39b5a commit 104c2b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions freertos-rust/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,6 @@ impl Task {
}
}

/// Take the notification and either clear the notification value or decrement it by one.
pub fn take_notification<D: DurationTicks>(&self, clear: bool, wait_for: D) -> u32 {
unsafe { freertos_rs_task_notify_take(if clear { 1 } else { 0 }, wait_for.to_ticks()) }
}

/// Wait for a notification to be posted.
pub fn wait_for_notification<D: DurationTicks>(
&self,
Expand Down Expand Up @@ -315,6 +310,11 @@ impl CurrentTask {
}
}

/// Take the notification and either clear the notification value or decrement it by one.
pub fn take_notification<D: DurationTicks>(clear: bool, wait_for: D) -> u32 {
unsafe { freertos_rs_task_notify_take(if clear { 1 } else { 0 }, wait_for.to_ticks()) }
}

/// Get the minimum amount of stack that was ever left on the current task.
pub fn get_stack_high_water_mark() -> u32 {
unsafe { freertos_rs_get_stack_high_water_mark(0 as FreeRtosTaskHandle) as u32 }
Expand Down

0 comments on commit 104c2b9

Please sign in to comment.