aboutsummaryrefslogtreecommitdiff
path: root/ui/v6m-interrupt-not-enough.rs_no
blob: 3fbf3cf7bf05df202b562294fb4ac5d1e5bf61e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! v6m-interrupt-not-enough.rs_no (not run atm)
//!
//! Expected behavior:
//! should pass
//! > cargo build --example m0_perf_err  --target thumbv7m-none-eabi --release
//!
//! should fail
//! > cargo build --example m0_perf_err  --target thumbv6m-none-eabi --release
//! Compiling cortex-m-rtic v1.0.0 (/home/pln/rust/rtic/cortex-m-rtic)
//! error[E0308]: mismatched types
//! --> examples/m0_perf_err.rs:25:1
//!  |
//! 25 | #[rtic::app(device = lm3s6965)]
//!  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an array with a fixed size of 4 elements, found one with 5 elements
//!  |
//!  = note: this error originates in the attribute macro `rtic::app` (in Nightly builds, run with -Z macro-backtrace for more info)

#![deny(unsafe_code)]
#![deny(warnings)]
#![no_main]
#![no_std]

use panic_semihosting as _;

#[rtic::app(device = lm3s6965)]
mod app {

    use cortex_m_semihosting::debug;

    #[shared]
    struct Shared {}

    #[local]
    struct Local {}

    #[init]
    fn init(_: init::Context) -> (Shared, Local, init::Monotonics) {
        (Shared {}, Local {}, init::Monotonics())
    }

    #[inline(never)]
    #[idle]
    fn idle(_cx: idle::Context) -> ! {
        debug::exit(debug::EXIT_SUCCESS); // Exit QEMU simulator

        loop {
            cortex_m::asm::nop();
        }
    }

    // priority to high for v6m
    #[task(binds = GPIOA, priority = 5)]
    fn t0(_cx: t0::Context) {}
}