rtfm: migrate to rtic

This commit is contained in:
Robert Jördens 2020-06-17 12:20:45 +02:00
parent 5eb30ead74
commit f70612f1be
3 changed files with 25 additions and 18 deletions

33
Cargo.lock generated
View File

@ -137,27 +137,28 @@ dependencies = [
] ]
[[package]] [[package]]
name = "cortex-m-rtfm" name = "cortex-m-rtic"
version = "0.5.1" version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf0b9fd3f042cb3793d15daf3cea201b2f25c99b0b5b936a551bb6909c3ae5b" checksum = "04cd388b154c7e7d212c5af7541ee1f174f29ccb0c22e9117f8d13a5aad233b6"
dependencies = [ dependencies = [
"cortex-m", "cortex-m",
"cortex-m-rt", "cortex-m-rt",
"cortex-m-rtfm-macros", "cortex-m-rtic-macros",
"heapless", "heapless",
"rtfm-core", "rtic-core",
"version_check",
] ]
[[package]] [[package]]
name = "cortex-m-rtfm-macros" name = "cortex-m-rtic-macros"
version = "0.5.0" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c62092f6ff344e9b0adb748f0302ed69889ba2fae1fce446e3788d4726ea73bb" checksum = "29e29e01b3ec80d59bfd96aaf94d04008bebfde3ab7016e12bfbd6c0b466d22a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rtfm-syntax", "rtic-syntax",
"syn", "syn",
] ]
@ -347,16 +348,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f" checksum = "e2a38df5b15c8d5c7e8654189744d8e396bddc18ad48041a500ce52d6948941f"
[[package]] [[package]]
name = "rtfm-core" name = "rtic-core"
version = "0.3.0" version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ec893edb2aa5b70320b94896ffea22a7ebb1cf3f942bb67cd5b60a865a63493" checksum = "ab51fe832317e805f869b3d859f91aadf855c2c3da51f9b84bc645c201597158"
[[package]] [[package]]
name = "rtfm-syntax" name = "rtic-syntax"
version = "0.4.0" version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4455e23c34df3d66454e7e218a4d76a7f83321d04a806be614463341cec4116e" checksum = "8152fcaa845720d61e6cc570548b89144c2c307f18a480bbd97e55e9f6eeff04"
dependencies = [ dependencies = [
"indexmap", "indexmap",
"proc-macro2", "proc-macro2",
@ -438,7 +439,7 @@ dependencies = [
"cortex-m", "cortex-m",
"cortex-m-log", "cortex-m-log",
"cortex-m-rt", "cortex-m-rt",
"cortex-m-rtfm", "cortex-m-rtic",
"embedded-hal", "embedded-hal",
"enum-iterator", "enum-iterator",
"heapless", "heapless",
@ -545,6 +546,12 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "876e32dcadfe563a4289e994f7cb391197f362b6315dc45e8ba4aa6f564a4b3c" checksum = "876e32dcadfe563a4289e994f7cb391197f362b6315dc45e8ba4aa6f564a4b3c"
[[package]]
name = "version_check"
version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
[[package]] [[package]]
name = "void" name = "void"
version = "1.0.2" version = "1.0.2"

View File

@ -35,7 +35,7 @@ panic-halt = "0.2"
serde = { version = "1.0", features = ["derive"], default-features = false } serde = { version = "1.0", features = ["derive"], default-features = false }
heapless = { version = "0.5", features = ["serde"] } heapless = { version = "0.5", features = ["serde"] }
serde-json-core = "0.1" serde-json-core = "0.1"
cortex-m-rtfm = "0.5" cortex-m-rtic = "0.5.3"
embedded-hal = "0.2.3" embedded-hal = "0.2.3"
nb = "0.1.2" nb = "0.1.2"
asm-delay = "0.7.2" asm-delay = "0.7.2"

View File

@ -31,7 +31,7 @@ extern crate log;
use asm_delay; use asm_delay;
use cortex_m; use cortex_m;
use cortex_m_rt::exception; use cortex_m_rt::exception;
use rtfm::cyccnt::{Instant, U32Ext}; use rtic::cyccnt::{Instant, U32Ext};
use stm32h7xx_hal as hal; use stm32h7xx_hal as hal;
use stm32h7xx_hal::prelude::*; use stm32h7xx_hal::prelude::*;
@ -159,7 +159,7 @@ macro_rules! route_request {
} }
} }
#[rtfm::app(device = stm32h7xx_hal::stm32, peripherals = true, monotonic = rtfm::cyccnt::CYCCNT)] #[rtic::app(device = stm32h7xx_hal::stm32, peripherals = true, monotonic = rtic::cyccnt::CYCCNT)]
const APP: () = { const APP: () = {
struct Resources { struct Resources {
adc1: hal::spi::Spi<hal::stm32::SPI2>, adc1: hal::spi::Spi<hal::stm32::SPI2>,
@ -604,7 +604,7 @@ const APP: () = {
// info!("Built on {}", build_info::BUILT_TIME_UTC); // info!("Built on {}", build_info::BUILT_TIME_UTC);
// info!("{} {}", build_info::RUSTC_VERSION, build_info::TARGET); // info!("{} {}", build_info::RUSTC_VERSION, build_info::TARGET);
// Utilize the cycle counter for RTFM scheduling. // Utilize the cycle counter for RTIC scheduling.
cp.DWT.enable_cycle_counter(); cp.DWT.enable_cycle_counter();
let mut dma = hal::dma::Dma::dma(dp.DMA1, dp.DMAMUX1, &clocks); let mut dma = hal::dma::Dma::dma(dp.DMA1, dp.DMAMUX1, &clocks);
@ -849,7 +849,7 @@ const APP: () = {
} }
extern "C" { extern "C" {
// hw interrupt handlers for RTFM to use for scheduling tasks // hw interrupt handlers for RTIC to use for scheduling tasks
// one per priority // one per priority
fn DCMI(); fn DCMI();
fn JPEG(); fn JPEG();