Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gdobato committed May 31, 2024
1 parent 679756b commit 1e1a61b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ stm32h7xx-hal = { version = "0.16.0", features = [
"rt",
"usb_hs",
] }
defmt = "=0.3.7"
defmt = "=0.3.8"
defmt-rtt = "0.4.1"
panic-probe = { version = "0.3", features = ["print-defmt"] }

[dev-dependencies]
rtic = { version = "2.1.1", features = ["thumbv7-backend"] }
rtic-monotonics = { version = "1.5.0", features = ["cortex-m-systick"] }
rtic-monotonics = { version = "2.0.0", features = ["cortex-m-systick"] }
static_cell = "2.1.0"
usb-device = "0.3.2"
usbd-serial = "0.2.2"
Expand Down
18 changes: 8 additions & 10 deletions examples/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use portenta_h7::{
led,
};
use rtic::app;
use rtic_monotonics::systick::*;
use rtic_monotonics::systick::prelude::*;

systick_monotonic!(Mono, 1000);

#[app(device = portenta_h7::hal::pac, peripherals = false, dispatchers = [SPI1])]
mod app {
Expand All @@ -31,12 +33,8 @@ mod app {
#[init]
fn init(cx: init::Context) -> (Shared, Local) {
info!("Init");
let systick_mono_token = rtic_monotonics::create_systick_token!();
Systick::start(
cx.core.SYST,
board::CORE_FREQUENCY.raw(),
systick_mono_token,
);

Mono::start(cx.core.SYST, board::CORE_FREQUENCY.raw());

// Get board resources
let Board {
Expand Down Expand Up @@ -66,23 +64,23 @@ mod app {
async fn blink_led_red(cx: blink_led_red::Context) {
loop {
cx.local.led_red.toggle();
Systick::delay(500.millis()).await;
Mono::delay(500.millis()).await;
}
}

#[task(local = [led_green])]
async fn blink_led_green(cx: blink_led_green::Context) {
loop {
cx.local.led_green.toggle();
Systick::delay(1000.millis()).await;
Mono::delay(1000.millis()).await;
}
}

#[task(local = [led_blue])]
async fn blink_led_blue(cx: blink_led_blue::Context) {
loop {
cx.local.led_blue.toggle();
Systick::delay(1000.millis()).await;
Mono::delay(1000.millis()).await;
}
}
}
12 changes: 4 additions & 8 deletions examples/usb_echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ use portenta_h7::{
led::{self, Led},
};
use rtic::app;
use rtic_monotonics::systick::*;
use rtic_monotonics::systick::prelude::*;
use static_cell::StaticCell;
use usb_device::{class_prelude::UsbBusAllocator, prelude::*};
use usbd_serial::CdcAcmClass;

systick_monotonic!(Mono, 1000);

#[app(device = portenta_h7::hal::pac, peripherals = false)]
mod app {
use super::*;
Expand All @@ -41,13 +43,7 @@ mod app {
fn init(cx: init::Context) -> (Shared, Local) {
info!("Init");

let systick_mono_token = rtic_monotonics::create_systick_token!();

Systick::start(
cx.core.SYST,
board::CORE_FREQUENCY.raw(),
systick_mono_token,
);
Mono::start(cx.core.SYST, board::CORE_FREQUENCY.raw());

// Get board resources
let Board { led_blue, usb, .. } = Board::take();
Expand Down

0 comments on commit 1e1a61b

Please sign in to comment.