diff options
author | 2018-09-06 00:44:19 +0000 | |
---|---|---|
committer | 2018-09-06 00:44:19 +0000 | |
commit | 7854e96f69f98570504c701ae860175efc7a25d9 (patch) | |
tree | eaf897d43263606e24b6cca9f5f6620498648dc6 /cortex-m-rt/examples/pre_init.rs | |
parent | 0fb051055a0340ad6c5b59d18183c260468e455f (diff) | |
parent | 31713aba3f4a4aacd55d12b8a3435334ae61986a (diff) | |
download | cortex-m-7854e96f69f98570504c701ae860175efc7a25d9.tar.gz cortex-m-7854e96f69f98570504c701ae860175efc7a25d9.tar.zst cortex-m-7854e96f69f98570504c701ae860175efc7a25d9.zip |
Merge #90
90: turn macros into attributes r=adamgreig a=japaric
This is a PoC implementation of RFC #82. Assuming that we are OK with this implementation we should
add some compile fail tests (e.g. using a function with the wrong signature as the entry point)
before landing this.
Look at the diff of the examples to get an overview of the changes.
cc @rust-embedded/cortex-m
Co-authored-by: Jorge Aparicio <jorge@japaric.io>
Diffstat (limited to 'cortex-m-rt/examples/pre_init.rs')
-rw-r--r-- | cortex-m-rt/examples/pre_init.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/cortex-m-rt/examples/pre_init.rs b/cortex-m-rt/examples/pre_init.rs index 7258936..00e2f2c 100644 --- a/cortex-m-rt/examples/pre_init.rs +++ b/cortex-m-rt/examples/pre_init.rs @@ -4,19 +4,17 @@ #![no_main] #![no_std] -#[macro_use(entry, pre_init)] extern crate cortex_m_rt as rt; extern crate panic_semihosting; -pre_init!(disable_watchdog); +use rt::{entry, pre_init}; +#[pre_init] unsafe fn disable_watchdog() { // Do what you need to disable the watchdog. } -// the program entry point -entry!(main); - +#[entry] fn main() -> ! { loop {} } |