Skip to content
Snippets Groups Projects
Commit b7b96ccd authored by Per's avatar Per
Browse files

to fresk

parent 0b025202
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,18 @@ ...@@ -75,6 +75,18 @@
"isDefault": true "isDefault": true
} }
}, },
{
"type": "shell",
"label": "cargo build --example rtfm_interrupt --features stm32f4",
"command": "cargo build --example rtfm_interrupt --features stm32f4",
"problemMatcher": [
"$rustc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{ {
"type": "shell", "type": "shell",
"label": "cargo build --example bare0", "label": "cargo build --example bare0",
......
...@@ -6,11 +6,12 @@ name = "app" ...@@ -6,11 +6,12 @@ name = "app"
version = "0.1.0" version = "0.1.0"
# [patch.crates-io] # [patch.crates-io]
# stm32f4xx-hal = { path = "../stm32f4xx-hal" } # # stm32f4xx-hal = { path = "../stm32f4xx-hal" }
# stm32fxx-hal = {git = "https://github.com/stm32-rs/stm32f4xx-hal.git" }
[dependencies] [dependencies]
cortex-m-rt = "0.6.7" cortex-m-rt = "0.6.7"
# cortex-m-semihosting = "0.3.2" cortex-m-semihosting = "0.3.2"
panic-halt = "0.2.0" panic-halt = "0.2.0"
# panic-abort = "0.3.1" # requires nightly toolchain # panic-abort = "0.3.1" # requires nightly toolchain
...@@ -29,18 +30,19 @@ features = ["inline-asm"] # <- currently requires nightly compiler ...@@ -29,18 +30,19 @@ features = ["inline-asm"] # <- currently requires nightly compiler
[dependencies.stm32f4] [dependencies.stm32f4]
version = "0.5.0" version = "0.5.0"
features = ["stm32f411", "rt"] features = ["stm32f413", "rt"]
# optional = true # optional = true
[dependencies.stm32f4xx-hal] [dependencies.stm32f4xx-hal]
git = "https://github.com/stm32-rs/stm32f4xx-hal.git"
version = "0.2.8" version = "0.2.8"
features = ["stm32f411", "rt"] features = ["stm32f413", "rt"]
# this lets you use `cargo fix`! # this lets you use `cargo fix`!
# [[bin]] [[bin]]
# name = "app" name = "app"
# test = false test = false
# bench = false bench = false
[profile.dev] [profile.dev]
incremental = false incremental = false
......
...@@ -26,11 +26,13 @@ ...@@ -26,11 +26,13 @@
extern crate panic_halt; extern crate panic_halt;
use cortex_m::{iprint, iprintln, peripheral::itm::Stim, peripheral::syst::SystClkSource}; use cortex_m::{iprintln, peripheral::itm::Stim};
use cortex_m_rt::{entry, exception}; use cortex_m_rt::{entry};
use stm32f4::stm32f411; use stm32f4::stm32f411;
use stm32f411::{interrupt, Interrupt, DWT, GPIOA, GPIOC, ITM, NVIC, RCC, SYST}; use stm32f411::{
DWT, GPIOA, GPIOC, RCC,
};
#[entry] #[entry]
fn main() -> ! { fn main() -> ! {
......
...@@ -5,14 +5,14 @@ ...@@ -5,14 +5,14 @@
extern crate panic_halt; extern crate panic_halt;
extern crate stm32f4xx_hal as hal; extern crate stm32f4;
//extern crate stm32f4xx_hal as hal;
// use crate::hal::stm32::Interrupt::EXTI0; // use crate::hal::stm32::Interrupt::EXTI0;
use rtfm::app; use rtfm::app;
// use hal::stm32::Interrupt::EXTI0; // use hal::stm32::Interrupt::EXTI0;
#[app(device = hal::stm32)] #[app(device = stm32f4::stm32f413)]
// #[app(device = stm32f4xx_hal::stm32)]
const APP: () = { const APP: () = {
// init runs in an interrupt free section // init runs in an interrupt free section
...@@ -21,4 +21,7 @@ const APP: () = { ...@@ -21,4 +21,7 @@ const APP: () = {
#[interrupt] #[interrupt]
fn EXTI0() {} fn EXTI0() {}
#[interrupt]
fn USART2() {}
}; };
//! Prints "Hello, world!" on the host console using semihosting
#![no_main]
#![no_std]
extern crate panic_halt;
use cortex_m_rt::entry;
use cortex_m_semihosting::hprintln;
#[entry]
fn main() -> ! {
hprintln!("Hello, world!").unwrap();
loop {}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment