mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-01-06 01:09:02 +01:00
Fix documentation (docs.rs) and release 2.1.2
This commit is contained in:
parent
f17915842f
commit
b41a10e794
8 changed files with 34 additions and 28 deletions
|
@ -7,10 +7,11 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top!
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
- Replace `proc-macro-error` with `proc-macro-error2`
|
## [v2.1.1] - 2024-12-06
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
- Replace `proc-macro-error` with `proc-macro-error2`
|
||||||
- Fix codegen emitting unqualified `Result`
|
- Fix codegen emitting unqualified `Result`
|
||||||
- Improve error output for prios > dispatchers
|
- Improve error output for prios > dispatchers
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ name = "rtic-macros"
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
repository = "https://github.com/rtic-rs/rtic"
|
repository = "https://github.com/rtic-rs/rtic"
|
||||||
|
|
||||||
version = "2.1.0"
|
version = "2.1.1"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
|
@ -161,7 +161,7 @@ pub struct ExclusiveAccess<'a, T> {
|
||||||
inner: &'a mut T,
|
inner: &'a mut T,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> Drop for ExclusiveAccess<'a, T> {
|
impl<T> Drop for ExclusiveAccess<'_, T> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
critical_section::with(|_| {
|
critical_section::with(|_| {
|
||||||
fence(Ordering::SeqCst);
|
fence(Ordering::SeqCst);
|
||||||
|
@ -177,7 +177,7 @@ impl<'a, T> Drop for ExclusiveAccess<'a, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> Deref for ExclusiveAccess<'a, T> {
|
impl<T> Deref for ExclusiveAccess<'_, T> {
|
||||||
type Target = T;
|
type Target = T;
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
|
@ -185,7 +185,7 @@ impl<'a, T> Deref for ExclusiveAccess<'a, T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> DerefMut for ExclusiveAccess<'a, T> {
|
impl<T> DerefMut for ExclusiveAccess<'_, T> {
|
||||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||||
self.inner
|
self.inner
|
||||||
}
|
}
|
||||||
|
@ -215,7 +215,7 @@ pub mod spi {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, BUS, CS, D> ErrorType for ArbiterDevice<'a, BUS, CS, D>
|
impl<BUS, CS, D> ErrorType for ArbiterDevice<'_, BUS, CS, D>
|
||||||
where
|
where
|
||||||
BUS: ErrorType,
|
BUS: ErrorType,
|
||||||
CS: OutputPin,
|
CS: OutputPin,
|
||||||
|
@ -223,7 +223,7 @@ pub mod spi {
|
||||||
type Error = DeviceError<BUS::Error, CS::Error>;
|
type Error = DeviceError<BUS::Error, CS::Error>;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Word, BUS, CS, D> SpiDevice<Word> for ArbiterDevice<'a, BUS, CS, D>
|
impl<Word, BUS, CS, D> SpiDevice<Word> for ArbiterDevice<'_, BUS, CS, D>
|
||||||
where
|
where
|
||||||
Word: Copy + 'static,
|
Word: Copy + 'static,
|
||||||
BUS: SpiBus<Word>,
|
BUS: SpiBus<Word>,
|
||||||
|
@ -338,14 +338,14 @@ pub mod i2c {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, BUS> ErrorType for ArbiterDevice<'a, BUS>
|
impl<BUS> ErrorType for ArbiterDevice<'_, BUS>
|
||||||
where
|
where
|
||||||
BUS: ErrorType,
|
BUS: ErrorType,
|
||||||
{
|
{
|
||||||
type Error = BUS::Error;
|
type Error = BUS::Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, BUS, A> I2c<A> for ArbiterDevice<'a, BUS>
|
impl<BUS, A> I2c<A> for ArbiterDevice<'_, BUS>
|
||||||
where
|
where
|
||||||
BUS: I2c<A>,
|
BUS: I2c<A>,
|
||||||
A: AddressMode,
|
A: AddressMode,
|
||||||
|
|
|
@ -127,7 +127,10 @@ macro_rules! make_channel {
|
||||||
|
|
||||||
// SAFETY: This is safe as we hide the static mut from others to access it.
|
// SAFETY: This is safe as we hide the static mut from others to access it.
|
||||||
// Only this point is where the mutable access happens.
|
// Only this point is where the mutable access happens.
|
||||||
unsafe { CHANNEL.split() }
|
#[allow(static_mut_refs)]
|
||||||
|
unsafe {
|
||||||
|
CHANNEL.split()
|
||||||
|
}
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +187,7 @@ where
|
||||||
/// A `Sender` can send to the channel and can be cloned.
|
/// A `Sender` can send to the channel and can be cloned.
|
||||||
pub struct Sender<'a, T, const N: usize>(&'a Channel<T, N>);
|
pub struct Sender<'a, T, const N: usize>(&'a Channel<T, N>);
|
||||||
|
|
||||||
unsafe impl<'a, T, const N: usize> Send for Sender<'a, T, N> {}
|
unsafe impl<T, const N: usize> Send for Sender<'_, T, N> {}
|
||||||
|
|
||||||
/// This is needed to make the async closure in `send` accept that we "share"
|
/// This is needed to make the async closure in `send` accept that we "share"
|
||||||
/// the link possible between threads.
|
/// the link possible between threads.
|
||||||
|
@ -202,20 +205,20 @@ unsafe impl Send for LinkPtr {}
|
||||||
|
|
||||||
unsafe impl Sync for LinkPtr {}
|
unsafe impl Sync for LinkPtr {}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> core::fmt::Debug for Sender<'a, T, N> {
|
impl<T, const N: usize> core::fmt::Debug for Sender<'_, T, N> {
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||||
write!(f, "Sender")
|
write!(f, "Sender")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "defmt-03")]
|
#[cfg(feature = "defmt-03")]
|
||||||
impl<'a, T, const N: usize> defmt::Format for Sender<'a, T, N> {
|
impl<T, const N: usize> defmt::Format for Sender<'_, T, N> {
|
||||||
fn format(&self, f: defmt::Formatter) {
|
fn format(&self, f: defmt::Formatter) {
|
||||||
defmt::write!(f, "Sender",)
|
defmt::write!(f, "Sender",)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> Sender<'a, T, N> {
|
impl<T, const N: usize> Sender<'_, T, N> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn send_footer(&mut self, idx: u8, val: T) {
|
fn send_footer(&mut self, idx: u8, val: T) {
|
||||||
// Write the value to the slots, note; this memcpy is not under a critical section.
|
// Write the value to the slots, note; this memcpy is not under a critical section.
|
||||||
|
@ -360,7 +363,7 @@ impl<'a, T, const N: usize> Sender<'a, T, N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> Drop for Sender<'a, T, N> {
|
impl<T, const N: usize> Drop for Sender<'_, T, N> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// Count down the reference counter
|
// Count down the reference counter
|
||||||
let num_senders = critical_section::with(|cs| {
|
let num_senders = critical_section::with(|cs| {
|
||||||
|
@ -376,7 +379,7 @@ impl<'a, T, const N: usize> Drop for Sender<'a, T, N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> Clone for Sender<'a, T, N> {
|
impl<T, const N: usize> Clone for Sender<'_, T, N> {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
// Count up the reference counter
|
// Count up the reference counter
|
||||||
critical_section::with(|cs| *self.0.access(cs).num_senders += 1);
|
critical_section::with(|cs| *self.0.access(cs).num_senders += 1);
|
||||||
|
@ -390,16 +393,16 @@ impl<'a, T, const N: usize> Clone for Sender<'a, T, N> {
|
||||||
/// A receiver of the channel. There can only be one receiver at any time.
|
/// A receiver of the channel. There can only be one receiver at any time.
|
||||||
pub struct Receiver<'a, T, const N: usize>(&'a Channel<T, N>);
|
pub struct Receiver<'a, T, const N: usize>(&'a Channel<T, N>);
|
||||||
|
|
||||||
unsafe impl<'a, T, const N: usize> Send for Receiver<'a, T, N> {}
|
unsafe impl<T, const N: usize> Send for Receiver<'_, T, N> {}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> core::fmt::Debug for Receiver<'a, T, N> {
|
impl<T, const N: usize> core::fmt::Debug for Receiver<'_, T, N> {
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||||
write!(f, "Receiver")
|
write!(f, "Receiver")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "defmt-03")]
|
#[cfg(feature = "defmt-03")]
|
||||||
impl<'a, T, const N: usize> defmt::Format for Receiver<'a, T, N> {
|
impl<T, const N: usize> defmt::Format for Receiver<'_, T, N> {
|
||||||
fn format(&self, f: defmt::Formatter) {
|
fn format(&self, f: defmt::Formatter) {
|
||||||
defmt::write!(f, "Receiver",)
|
defmt::write!(f, "Receiver",)
|
||||||
}
|
}
|
||||||
|
@ -415,7 +418,7 @@ pub enum ReceiveError {
|
||||||
Empty,
|
Empty,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> Receiver<'a, T, N> {
|
impl<T, const N: usize> Receiver<'_, T, N> {
|
||||||
/// Receives a value if there is one in the channel, non-blocking.
|
/// Receives a value if there is one in the channel, non-blocking.
|
||||||
pub fn try_recv(&mut self) -> Result<T, ReceiveError> {
|
pub fn try_recv(&mut self) -> Result<T, ReceiveError> {
|
||||||
// Try to get a ready slot.
|
// Try to get a ready slot.
|
||||||
|
@ -487,7 +490,7 @@ impl<'a, T, const N: usize> Receiver<'a, T, N> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T, const N: usize> Drop for Receiver<'a, T, N> {
|
impl<T, const N: usize> Drop for Receiver<'_, T, N> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// Mark the receiver as dropped and wake all waiters
|
// Mark the receiver as dropped and wake all waiters
|
||||||
critical_section::with(|cs| *self.0.access(cs).receiver_dropped = true);
|
critical_section::with(|cs| *self.0.access(cs).receiver_dropped = true);
|
||||||
|
|
|
@ -71,7 +71,7 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T: Copy> SignalWriter<'a, T> {
|
impl<T: Copy> SignalWriter<'_, T> {
|
||||||
/// Write a raw Store value to the Signal.
|
/// Write a raw Store value to the Signal.
|
||||||
fn write_inner(&mut self, value: Store<T>) {
|
fn write_inner(&mut self, value: Store<T>) {
|
||||||
critical_section::with(|_| {
|
critical_section::with(|_| {
|
||||||
|
|
|
@ -211,7 +211,7 @@ pub struct Delay<'q, Backend: TimerQueueBackend> {
|
||||||
marker: AtomicUsize,
|
marker: AtomicUsize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'q, Backend: TimerQueueBackend> Future for Delay<'q, Backend> {
|
impl<Backend: TimerQueueBackend> Future for Delay<'_, Backend> {
|
||||||
type Output = ();
|
type Output = ();
|
||||||
|
|
||||||
fn poll(self: Pin<&mut Self>, cx: &mut core::task::Context<'_>) -> Poll<Self::Output> {
|
fn poll(self: Pin<&mut Self>, cx: &mut core::task::Context<'_>) -> Poll<Self::Output> {
|
||||||
|
@ -249,7 +249,7 @@ impl<'q, Backend: TimerQueueBackend> Future for Delay<'q, Backend> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'q, Backend: TimerQueueBackend> Drop for Delay<'q, Backend> {
|
impl<Backend: TimerQueueBackend> Drop for Delay<'_, Backend> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// SAFETY: Drop cannot be run at the same time as poll, so we can't end up
|
// SAFETY: Drop cannot be run at the same time as poll, so we can't end up
|
||||||
// derefencing this concurrently to the one in `poll`.
|
// derefencing this concurrently to the one in `poll`.
|
||||||
|
@ -269,7 +269,7 @@ pub struct Timeout<'q, Backend: TimerQueueBackend, F> {
|
||||||
future: F,
|
future: F,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'q, Backend: TimerQueueBackend, F: Future> Future for Timeout<'q, Backend, F> {
|
impl<Backend: TimerQueueBackend, F: Future> Future for Timeout<'_, Backend, F> {
|
||||||
type Output = Result<F::Output, TimeoutError>;
|
type Output = Result<F::Output, TimeoutError>;
|
||||||
|
|
||||||
fn poll(self: Pin<&mut Self>, cx: &mut core::task::Context<'_>) -> Poll<Self::Output> {
|
fn poll(self: Pin<&mut Self>, cx: &mut core::task::Context<'_>) -> Poll<Self::Output> {
|
||||||
|
|
|
@ -20,6 +20,8 @@ Example:
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [v2.1.2] - 2024-12-06
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- Updated esp32c3 dependency to v0.26.0
|
- Updated esp32c3 dependency to v0.26.0
|
||||||
|
|
|
@ -16,10 +16,10 @@ name = "rtic"
|
||||||
readme = "../README.md"
|
readme = "../README.md"
|
||||||
repository = "https://github.com/rtic-rs/rtic"
|
repository = "https://github.com/rtic-rs/rtic"
|
||||||
|
|
||||||
version = "2.1.1"
|
version = "2.1.2"
|
||||||
|
|
||||||
[package.metadata.docs.rs]
|
[package.metadata.docs.rs]
|
||||||
features = ["rtic-macros/test-template"]
|
features = ["thumbv7-backend"]
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "rtic"
|
name = "rtic"
|
||||||
|
@ -31,7 +31,7 @@ riscv = { version = "0.12.1", optional = true }
|
||||||
cortex-m = { version = "0.7.0", optional = true }
|
cortex-m = { version = "0.7.0", optional = true }
|
||||||
bare-metal = "1.0.0"
|
bare-metal = "1.0.0"
|
||||||
portable-atomic = { version = "1", default-features = false }
|
portable-atomic = { version = "1", default-features = false }
|
||||||
rtic-macros = { path = "../rtic-macros", version = "=2.1.0" }
|
rtic-macros = { path = "../rtic-macros", version = "=2.1.1" }
|
||||||
rtic-core = "1"
|
rtic-core = "1"
|
||||||
critical-section = "1"
|
critical-section = "1"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue