From 689c4a068eddfe32956c1975cdc241b26d1751da Mon Sep 17 00:00:00 2001 From: Emil Fresk Date: Sun, 2 Jun 2024 10:15:17 +0200 Subject: [PATCH] Make rtic-monotonic macros create a public type --- rtic-monotonics/CHANGELOG.md | 6 ++++++ rtic-monotonics/Cargo.toml | 2 +- rtic-monotonics/src/imxrt.rs | 2 +- rtic-monotonics/src/nrf/rtc.rs | 2 +- rtic-monotonics/src/nrf/timer.rs | 2 +- rtic-monotonics/src/rp2040.rs | 2 +- rtic-monotonics/src/stm32.rs | 3 ++- rtic-monotonics/src/systick.rs | 2 +- 8 files changed, 14 insertions(+), 7 deletions(-) diff --git a/rtic-monotonics/CHANGELOG.md b/rtic-monotonics/CHANGELOG.md index c88b767242..1a4211775e 100644 --- a/rtic-monotonics/CHANGELOG.md +++ b/rtic-monotonics/CHANGELOG.md @@ -7,6 +7,12 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! ## Unreleased +## v2.0.1 - 2024-06-02 + +### Changed + +- Make monotonics created with their respective macros public + ## v2.0.0 - 2024-05-29 ### Changed diff --git a/rtic-monotonics/Cargo.toml b/rtic-monotonics/Cargo.toml index d5be4b86ea..156f9b2f3c 100644 --- a/rtic-monotonics/Cargo.toml +++ b/rtic-monotonics/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rtic-monotonics" -version = "2.0.0" +version = "2.0.1" edition = "2021" authors = [ diff --git a/rtic-monotonics/src/imxrt.rs b/rtic-monotonics/src/imxrt.rs index 6d07be67d4..bfe63153b0 100644 --- a/rtic-monotonics/src/imxrt.rs +++ b/rtic-monotonics/src/imxrt.rs @@ -63,7 +63,7 @@ macro_rules! __internal_create_imxrt_timer_interrupt { macro_rules! __internal_create_imxrt_timer_struct { ($name:ident, $mono_backend:ident, $timer:ident, $tick_rate_hz:expr) => { /// A `Monotonic` based on the GPT peripheral. - struct $name; + pub struct $name; impl $name { /// Starts the `Monotonic`. diff --git a/rtic-monotonics/src/nrf/rtc.rs b/rtic-monotonics/src/nrf/rtc.rs index 5b9a90b572..6437f979a3 100644 --- a/rtic-monotonics/src/nrf/rtc.rs +++ b/rtic-monotonics/src/nrf/rtc.rs @@ -85,7 +85,7 @@ macro_rules! __internal_create_nrf_rtc_interrupt { macro_rules! __internal_create_nrf_rtc_struct { ($name:ident, $mono_backend:ident, $timer:ident) => { /// A `Monotonic` based on the nRF RTC peripheral. - struct $name; + pub struct $name; impl $name { /// Starts the `Monotonic`. diff --git a/rtic-monotonics/src/nrf/timer.rs b/rtic-monotonics/src/nrf/timer.rs index 3ec1dfe822..35e37435f4 100644 --- a/rtic-monotonics/src/nrf/timer.rs +++ b/rtic-monotonics/src/nrf/timer.rs @@ -95,7 +95,7 @@ macro_rules! __internal_create_nrf_timer_interrupt { macro_rules! __internal_create_nrf_timer_struct { ($name:ident, $mono_backend:ident, $timer:ident, $tick_rate_hz:expr) => { /// A `Monotonic` based on the nRF Timer peripheral. - struct $name; + pub struct $name; impl $name { /// Starts the `Monotonic`. diff --git a/rtic-monotonics/src/rp2040.rs b/rtic-monotonics/src/rp2040.rs index 9c5a1ddfe4..47146b45fa 100644 --- a/rtic-monotonics/src/rp2040.rs +++ b/rtic-monotonics/src/rp2040.rs @@ -130,7 +130,7 @@ impl TimerQueueBackend for TimerBackend { macro_rules! rp2040_timer_monotonic { ($name:ident) => { /// A `Monotonic` based on the RP2040 Timer peripheral. - struct $name; + pub struct $name; impl $name { /// Starts the `Monotonic`. diff --git a/rtic-monotonics/src/stm32.rs b/rtic-monotonics/src/stm32.rs index 92800c7416..4952882ef1 100644 --- a/rtic-monotonics/src/stm32.rs +++ b/rtic-monotonics/src/stm32.rs @@ -83,7 +83,8 @@ macro_rules! __internal_create_stm32_timer_interrupt { #[macro_export] macro_rules! __internal_create_stm32_timer_struct { ($name:ident, $mono_backend:ident, $timer:ident, $tick_rate_hz:expr) => { - struct $name; + /// A `Monotonic` based on an STM32 timer peripheral. + pub struct $name; impl $name { /// Starts the `Monotonic`. diff --git a/rtic-monotonics/src/systick.rs b/rtic-monotonics/src/systick.rs index cc6ea3e0e6..37cc2edf92 100644 --- a/rtic-monotonics/src/systick.rs +++ b/rtic-monotonics/src/systick.rs @@ -148,7 +148,7 @@ macro_rules! systick_monotonic { }; ($name:ident, $tick_rate_hz:expr) => { /// A `Monotonic` based on SysTick. - struct $name; + pub struct $name; impl $name { /// Starts the `Monotonic`.