mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
refactor(macro): used $crate for better interop
This commit is contained in:
parent
15b9db4c5d
commit
a071ab05b2
3 changed files with 5 additions and 5 deletions
|
@ -144,12 +144,12 @@ macro_rules! make_rp2040_monotonic_handler {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
unsafe extern "C" fn TIMER_IRQ_0() {
|
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;
|
pub struct Rp2040Token;
|
||||||
|
|
||||||
unsafe impl rtic_monotonics::InterruptToken<rtic_monotonics::rp2040::Timer>
|
unsafe impl $crate::InterruptToken<rtic_monotonics::rp2040::Timer>
|
||||||
for Rp2040Token
|
for Rp2040Token
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,12 +162,12 @@ macro_rules! make_systick_handler {
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
unsafe extern "C" fn SysTick() {
|
unsafe extern "C" fn SysTick() {
|
||||||
rtic_monotonics::systick::Systick::__tq().on_monotonic_interrupt();
|
$crate::systick::Systick::__tq().on_monotonic_interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct SystickToken;
|
pub struct SystickToken;
|
||||||
|
|
||||||
unsafe impl rtic_monotonics::InterruptToken<rtic_monotonics::systick::Systick>
|
unsafe impl $crate::InterruptToken<rtic_monotonics::systick::Systick>
|
||||||
for SystickToken
|
for SystickToken
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ impl<T, const N: usize> Channel<T, N> {
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! make_channel {
|
macro_rules! make_channel {
|
||||||
($type:path, $size:expr) => {{
|
($type:path, $size:expr) => {{
|
||||||
static mut CHANNEL: ::rtic_sync::channel::Channel<$type, $size> = ::rtic_sync::channel::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.
|
// 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.
|
||||||
|
|
Loading…
Reference in a new issue