Skip to content
This repository was archived by the owner on Jul 29, 2025. It is now read-only.

Commit f6988f1

Browse files
committed
use less unstable dependencies
1 parent 43acbc4 commit f6988f1

File tree

3 files changed

+42
-4
lines changed

3 files changed

+42
-4
lines changed

Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ repository = "https://github.com/japaric/cortex-m-quickstart"
99
version = "0.2.7"
1010

1111
[dependencies]
12-
cortex-m = "0.4.0"
13-
cortex-m-rt = "0.4.0"
14-
cortex-m-semihosting = "0.2.0"
12+
# cortex-m = "0.4.0"
13+
# cortex-m-rt = "0.4.0"
14+
cortex-m-rt = { git = "https://github.com/japaric/cortex-m-rt", branch = "stable" }
15+
# cortex-m-semihosting = "0.2.0"
16+
# panic-loop = { path = "../panic-loop" }
1517
panic-abort = "0.1.1"
16-
panic-semihosting = "0.1.0"
18+
# panic-semihosting = "0.1.0"
1719
# Uncomment for the allocator example.
1820
#alloc-cortex-m = "0.3.3"
1921

examples/minimal.rs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#![no_main] // <- IMPORTANT!
2+
#![no_std]
3+
4+
#[macro_use]
5+
extern crate cortex_m_rt;
6+
extern crate panic_abort;
7+
8+
use core::ptr;
9+
10+
// user entry point
11+
main!(main);
12+
13+
fn main() -> ! {
14+
loop {
15+
unsafe {
16+
// NOTE side affect to avoid UB
17+
ptr::read_volatile(0x2000_0000 as *const u32);
18+
}
19+
}
20+
}
21+
22+
// define the default exception handler
23+
exception!(DefaultHandler, deh);
24+
25+
fn deh(_nr: u8) -> ! {
26+
loop {
27+
unsafe {
28+
// NOTE side affect to avoid UB
29+
ptr::read_volatile(0x2000_0004 as *const u32);
30+
}
31+
}
32+
}
33+
34+
// bind all interrupts to the default exception handler
35+
interrupts!(DefaultHandler);

interrupts.x

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* Remove this file if you are linking to a device crate that provides this file */

0 commit comments

Comments
 (0)