diff --git a/rtic-monotonics/CHANGELOG.md b/rtic-monotonics/CHANGELOG.md index 89f401fdd6..816bc24783 100644 --- a/rtic-monotonics/CHANGELOG.md +++ b/rtic-monotonics/CHANGELOG.md @@ -16,5 +16,6 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ### Fixed - Unmask the `rp2040` interrupt +- Use `$crate` and fully qualified paths in macros ## [v1.0.0] - 2023-xx-xx diff --git a/rtic-monotonics/src/rp2040.rs b/rtic-monotonics/src/rp2040.rs index 93472e6d39..6aa66ce0bc 100644 --- a/rtic-monotonics/src/rp2040.rs +++ b/rtic-monotonics/src/rp2040.rs @@ -139,22 +139,17 @@ impl embedded_hal_async::delay::DelayUs for Timer { /// Register the Timer interrupt for the monotonic. #[macro_export] macro_rules! make_rp2040_monotonic_handler { - () => { - { + () => {{ #[no_mangle] #[allow(non_snake_case)] unsafe extern "C" fn TIMER_IRQ_0() { - rtic_monotonics::rp2040::Timer::__tq().on_monotonic_interrupt(); + $crate::rp2040::Timer::__tq().on_monotonic_interrupt(); } pub struct Rp2040Token; - unsafe impl rtic_monotonics::InterruptToken - for Rp2040Token - { - } + unsafe impl $crate::InterruptToken<$crate::rp2040::Timer> for Rp2040Token {} Rp2040Token - } - }; + }}; } diff --git a/rtic-monotonics/src/systick.rs b/rtic-monotonics/src/systick.rs index feefc7ea05..b228e204d5 100644 --- a/rtic-monotonics/src/systick.rs +++ b/rtic-monotonics/src/systick.rs @@ -157,22 +157,17 @@ impl embedded_hal_async::delay::DelayUs for Systick { /// Register the Systick interrupt for the monotonic. #[macro_export] macro_rules! make_systick_handler { - () => { - { + () => {{ #[no_mangle] #[allow(non_snake_case)] unsafe extern "C" fn SysTick() { - rtic_monotonics::systick::Systick::__tq().on_monotonic_interrupt(); + $crate::systick::Systick::__tq().on_monotonic_interrupt(); } pub struct SystickToken; - unsafe impl rtic_monotonics::InterruptToken - for SystickToken - { - } + unsafe impl $crate::InterruptToken<$crate::systick::Systick> for SystickToken {} SystickToken - } - }; + }}; } diff --git a/rtic-sync/src/channel.rs b/rtic-sync/src/channel.rs index 8a817c81ba..b7b5a485fa 100644 --- a/rtic-sync/src/channel.rs +++ b/rtic-sync/src/channel.rs @@ -38,6 +38,7 @@ pub struct Channel { } unsafe impl Send for Channel {} + unsafe impl Sync for Channel {} struct UnsafeAccess<'a, const N: usize> { @@ -102,7 +103,8 @@ impl Channel { #[macro_export] macro_rules! make_channel { ($type:path, $size:expr) => {{ - static mut CHANNEL: Channel<$type, $size> = Channel::new(); + static mut CHANNEL: $crate::channel::Channel<$type, $size> = + $crate::channel::Channel::new(); // SAFETY: This is safe as we hide the static mut from others to access it. // Only this point is where the mutable access happens. @@ -176,6 +178,7 @@ impl LinkPtr { } unsafe impl Send for LinkPtr {} + unsafe impl Sync for LinkPtr {} impl<'a, T, const N: usize> core::fmt::Debug for Sender<'a, T, N> {