diff options
author | 2021-04-22 15:54:17 +0000 | |
---|---|---|
committer | 2021-04-22 15:54:17 +0000 | |
commit | a320cacb29e2297830ce5e95b704fc46915f725e (patch) | |
tree | 592e52a25d2b950057d7b2fc55a96a1cb71ceea4 | |
parent | e6a22aa48e088ef7c975d20d51e938b6b3205569 (diff) | |
parent | 6fc7b964748dab3161292fe7470aeadc8bf6e646 (diff) | |
download | rtic-a320cacb29e2297830ce5e95b704fc46915f725e.tar.gz rtic-a320cacb29e2297830ce5e95b704fc46915f725e.tar.zst rtic-a320cacb29e2297830ce5e95b704fc46915f725e.zip |
Merge #481
481: use super::xx now works with monotonics r=AfoHT a=korken89
Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
-rw-r--r-- | examples/t-schedule.rs | 4 | ||||
-rw-r--r-- | macros/src/codegen.rs | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/examples/t-schedule.rs b/examples/t-schedule.rs index d7051609..4ce62b47 100644 --- a/examples/t-schedule.rs +++ b/examples/t-schedule.rs @@ -7,11 +7,15 @@ use panic_semihosting as _; +pub struct SomeStruct; + #[rtic::app(device = lm3s6965, dispatchers = [SSI0])] mod app { use dwt_systick_monotonic::DwtSystick; use rtic::time::duration::Seconds; + use super::SomeStruct; + #[monotonic(binds = SysTick, default = true)] type MyMono = DwtSystick<8_000_000>; // 8 MHz diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index e0e09bbe..1096f6f1 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -163,6 +163,11 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { /// Holds static methods for each monotonic. pub mod monotonics { + #( + #[allow(unused_imports)] + #user_imports + )* + #(#monotonic_parts)* } ) |