/// Lock this semaphore in a RAII fashion
Lock this semaphore in a RAII fashion
Lock this semaphore in a RAII fashion
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<SemaphoreGuard, FreeRtosError> {
        unsafe {
            let res = freertos_rs_take_mutex(self.semaphore, max_wait.to_ticks());
            if res != 0 {
                return Err(FreeRtosError::Timeout);
            }
            Ok(SemaphoreGuard {
                __semaphore: self.semaphore,
            })
        }
    }
pub fn lock < D : DurationTicks > ( & self , max_wait : D ) -> Result < SemaphoreGuard , FreeRtosError > { unsafe { let res = freertos_rs_take_mutex ( self . semaphore , max_wait . to_ticks ( ) ) ; if res != 0 { return Err ( FreeRtosError :: Timeout ) ; } Ok ( SemaphoreGuard { __semaphore : self . semaphore , } ) } }
Lock this semaphore in a RAII fashion
Lock this semaphore in a RAII fashion
&self
max_wait
D