aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-30 20:12:17 +0000
committerGitHub <noreply@github.com>2020-06-30 20:12:17 +0000
commit629acdd70f06bd27ada1203fef3ba406d3de7d84 (patch)
tree644e4b079b38e3489539c6cc84d1ce60a5a7b5f7 /examples
parent8a4f9c6b8ae91bebeea0791680f89375a78bffc6 (diff)
parentd9e8b6866260172fd5244c5f734c7ba0893b7d62 (diff)
Merge #338
338: Fixes an issue where one could double take the cortex_m Peripheral r=japaric a=korken89 Closes #321 Co-authored-by: Emil Fresk <emil.fresk@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/peripherals-taken.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/peripherals-taken.rs b/examples/peripherals-taken.rs
new file mode 100644
index 0000000..cd4ba0f
--- /dev/null
+++ b/examples/peripherals-taken.rs
@@ -0,0 +1,16 @@
+#![deny(unsafe_code)]
+#![deny(warnings)]
+#![no_main]
+#![no_std]
+
+use cortex_m_semihosting::debug;
+use panic_semihosting as _;
+
+#[rtic::app(device = lm3s6965)]
+const APP: () = {
+ #[init]
+ fn main(_: main::Context) {
+ assert!(cortex_m::Peripherals::take().is_none());
+ debug::exit(debug::EXIT_SUCCESS);
+ }
+};