Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
publish:
runs-on: ubuntu-latest
# environment: release # Optional: for enhanced security
permissions:
id-token: write # Required for OIDC token exchange
steps:
- uses: actions/checkout@v4
- uses: rust-lang/crates-io-auth-action@v1
if: github.ref_type == 'tag'
id: auth
- uses: katyo/publish-crates@v2
with:
registry-token: ${{ steps.auth.outputs.token }}
dry-run: ${{ github.ref_type != 'tag' }}
ignore-unpublished-changes: true
6 changes: 3 additions & 3 deletions freertos-rust/src/critical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<T> ExclusiveData<T> {
}
}

pub fn lock(&self) -> Result<ExclusiveDataGuard<T>, FreeRtosError> {
pub fn lock(&self) -> Result<ExclusiveDataGuard<'_, T>, FreeRtosError> {
Ok(ExclusiveDataGuard {
__data: &self.data,
__lock: CriticalRegion::enter(),
Expand All @@ -47,7 +47,7 @@ impl<T> ExclusiveData<T> {
pub fn lock_from_isr(
&self,
_context: &mut crate::isr::InterruptContext,
) -> Result<ExclusiveDataGuardIsr<T>, FreeRtosError> {
) -> Result<ExclusiveDataGuardIsr<'_, T>, FreeRtosError> {
Ok(ExclusiveDataGuardIsr { __data: &self.data })
}
}
Expand Down Expand Up @@ -106,7 +106,7 @@ impl<T> SuspendScheduler<T> {
}
}

pub fn lock(&self) -> SuspendSchedulerGuard<T> {
pub fn lock(&self) -> SuspendSchedulerGuard<'_,T> {
unsafe {
freertos_rs_vTaskSuspendAll();
}
Expand Down
2 changes: 1 addition & 1 deletion freertos-rust/src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ where
}

/// Try to obtain a lock and mutable access to our inner value
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<MutexGuard<T, M>, FreeRtosError> {
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<MutexGuard<'_, T, M>, FreeRtosError> {
self.mutex.take(max_wait)?;

Ok(MutexGuard {
Expand Down
2 changes: 1 addition & 1 deletion freertos-rust/src/semaphore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Semaphore {
}

/// Lock this semaphore in a RAII fashion
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<SemaphoreGuard, FreeRtosError> {
pub fn lock<D: DurationTicks>(&self, max_wait: D) -> Result<SemaphoreGuard<'_>, FreeRtosError> {
self.take(max_wait).map(|()| SemaphoreGuard { owner: self })
}

Expand Down