From e12a084bfb1015371f8700aa4b79917744adb613 Mon Sep 17 00:00:00 2001 From: Jalon Wong Date: Mon, 11 Aug 2025 20:00:28 -0500 Subject: [PATCH] Fix the warning to pass CI --- freertos-rust/src/critical.rs | 6 +++--- freertos-rust/src/mutex.rs | 2 +- freertos-rust/src/semaphore.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freertos-rust/src/critical.rs b/freertos-rust/src/critical.rs index 79f8dea9..405d711e 100644 --- a/freertos-rust/src/critical.rs +++ b/freertos-rust/src/critical.rs @@ -37,7 +37,7 @@ impl ExclusiveData { } } - pub fn lock(&self) -> Result, FreeRtosError> { + pub fn lock(&self) -> Result, FreeRtosError> { Ok(ExclusiveDataGuard { __data: &self.data, __lock: CriticalRegion::enter(), @@ -47,7 +47,7 @@ impl ExclusiveData { pub fn lock_from_isr( &self, _context: &mut crate::isr::InterruptContext, - ) -> Result, FreeRtosError> { + ) -> Result, FreeRtosError> { Ok(ExclusiveDataGuardIsr { __data: &self.data }) } } @@ -106,7 +106,7 @@ impl SuspendScheduler { } } - pub fn lock(&self) -> SuspendSchedulerGuard { + pub fn lock(&self) -> SuspendSchedulerGuard<'_,T> { unsafe { freertos_rs_vTaskSuspendAll(); } diff --git a/freertos-rust/src/mutex.rs b/freertos-rust/src/mutex.rs index fb43eff0..6d71542b 100644 --- a/freertos-rust/src/mutex.rs +++ b/freertos-rust/src/mutex.rs @@ -36,7 +36,7 @@ where } /// Try to obtain a lock and mutable access to our inner value - pub fn lock(&self, max_wait: D) -> Result, FreeRtosError> { + pub fn lock(&self, max_wait: D) -> Result, FreeRtosError> { self.mutex.take(max_wait)?; Ok(MutexGuard { diff --git a/freertos-rust/src/semaphore.rs b/freertos-rust/src/semaphore.rs index 75ccef6d..cb5d4768 100644 --- a/freertos-rust/src/semaphore.rs +++ b/freertos-rust/src/semaphore.rs @@ -50,7 +50,7 @@ impl Semaphore { } /// Lock this semaphore in a RAII fashion - pub fn lock(&self, max_wait: D) -> Result { + pub fn lock(&self, max_wait: D) -> Result, FreeRtosError> { self.take(max_wait).map(|()| SemaphoreGuard { owner: self }) }