From 1a49d67490e3c1b9cb640d459890f4c880a52096 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 31 Aug 2021 19:50:50 +0200 Subject: [PATCH] validate unused dispatchers closes #521 --- macros/src/codegen/pre_init.rs | 11 +++++++---- ui/unknown-interrupt.rs | 15 +++++++++++++++ ui/unknown-interrupt.stderr | 5 +++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 ui/unknown-interrupt.rs create mode 100644 ui/unknown-interrupt.stderr diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index d3c4f54d9e..626d17a0a6 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -31,6 +31,13 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec Vec Vec (Shared, Local, init::Monotonics) { + (Shared {}, Local {}, init::Monotonics()) + } +} diff --git a/ui/unknown-interrupt.stderr b/ui/unknown-interrupt.stderr new file mode 100644 index 0000000000..d22310223f --- /dev/null +++ b/ui/unknown-interrupt.stderr @@ -0,0 +1,5 @@ +error[E0599]: no variant or associated item named `UnknownInterrupt` found for enum `Interrupt` in the current scope + --> examples/unknown-interrupt.rs:3:47 + | +3 | #[rtic::app(device = lm3s6965, dispatchers = [UnknownInterrupt])] + | ^^^^^^^^^^^^^^^^ variant or associated item not found in `Interrupt` \ No newline at end of file