diff options
Diffstat (limited to 'embassy-executor/src/metadata.rs')
| -rw-r--r-- | embassy-executor/src/metadata.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/embassy-executor/src/metadata.rs b/embassy-executor/src/metadata.rs index 81c5afafb..4220048a6 100644 --- a/embassy-executor/src/metadata.rs +++ b/embassy-executor/src/metadata.rs | |||
| @@ -63,8 +63,8 @@ impl Metadata { | |||
| 63 | 63 | ||
| 64 | /// Get this task's deadline. | 64 | /// Get this task's deadline. |
| 65 | #[cfg(feature = "scheduler-deadline")] | 65 | #[cfg(feature = "scheduler-deadline")] |
| 66 | pub fn deadline(&self) -> &raw::Deadline { | 66 | pub fn deadline(&self) -> u64 { |
| 67 | &self.deadline | 67 | self.deadline.instant_ticks() |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | /// Set this task's deadline. | 70 | /// Set this task's deadline. |
| @@ -79,7 +79,7 @@ impl Metadata { | |||
| 79 | /// This brings it back to the defaul where it's not scheduled ahead of other tasks. | 79 | /// This brings it back to the defaul where it's not scheduled ahead of other tasks. |
| 80 | #[cfg(feature = "scheduler-deadline")] | 80 | #[cfg(feature = "scheduler-deadline")] |
| 81 | pub fn unset_deadline(&self) { | 81 | pub fn unset_deadline(&self) { |
| 82 | self.deadline.set(Deadline::UNSET_DEADLINE_TICKS); | 82 | self.deadline.set(Deadline::UNSET_TICKS); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /// Set this task's deadline `duration_ticks` in the future from when | 85 | /// Set this task's deadline `duration_ticks` in the future from when |
| @@ -110,7 +110,7 @@ impl Metadata { | |||
| 110 | /// Returns the deadline that was set. | 110 | /// Returns the deadline that was set. |
| 111 | #[cfg(feature = "scheduler-deadline")] | 111 | #[cfg(feature = "scheduler-deadline")] |
| 112 | pub fn increment_deadline(&self, duration_ticks: u64) { | 112 | pub fn increment_deadline(&self, duration_ticks: u64) { |
| 113 | let last = self.deadline().instant_ticks(); | 113 | let last = self.deadline(); |
| 114 | 114 | ||
| 115 | // Since ticks is a u64, saturating add is PROBABLY overly cautious, leave | 115 | // Since ticks is a u64, saturating add is PROBABLY overly cautious, leave |
| 116 | // it for now, we can probably make this wrapping_add for performance | 116 | // it for now, we can probably make this wrapping_add for performance |
