Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cortex-m-rtic instead of cortex-m-rtfm #297

Merged
merged 1 commit into from
Dec 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Send stop after acknowledge errors on i2c
- Fix i2c interactions after errors

### Changed
- Use `cortex-m-rtic` instead of `cortex-m-rtfm` in the examples

## [v0.7.0]- 2020-10-17

### Breaking changes
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ optional = true
panic-halt = "0.2.0"
panic-semihosting = "0.5.2"
panic-itm = "0.4.1"
cortex-m-rtfm = "0.5"
cortex-m-rtic = "0.5"
cortex-m-semihosting = "0.3.3"
heapless = "0.4.3"
m = "0.1.1"
Expand Down Expand Up @@ -109,7 +109,7 @@ name = "usb_serial_interrupt"
required-features = ["rt", "stm32-usbd"]

[[example]]
name = "usb_serial_rtfm"
name = "usb_serial_rtic"
required-features = ["rt", "stm32-usbd"]

[[example]]
Expand All @@ -125,7 +125,7 @@ name = "qei"
required-features = ["medium"]

[[example]]
name = "timer-interrupt-rtfm"
name = "timer-interrupt-rtic"
required-features = ["rt", "medium"]

[[example]]
Expand Down
2 changes: 1 addition & 1 deletion examples/exti.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use stm32f1xx_hal::{pac, prelude::*};
// These two are owned by the ISR. main() may only access them during the initialization phase,
// where the interrupt is not yet enabled (i.e. no concurrent accesses can occur).
// After enabling the interrupt, main() may not have any references to these objects any more.
// For the sake of minimalism, we do not use RTFM here, which would be the better way.
// For the sake of minimalism, we do not use RTIC here, which would be the better way.
static mut LED: MaybeUninit<stm32f1xx_hal::gpio::gpioc::PC13<Output<PushPull>>> =
MaybeUninit::uninit();
static mut INT_PIN: MaybeUninit<stm32f1xx_hal::gpio::gpioa::PA7<Input<Floating>>> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// you can put a breakpoint on `rust_begin_unwind` to catch panics
use panic_halt as _;

use rtfm::app;
use rtic::app;

use embedded_hal::digital::v2::OutputPin;
use stm32f1xx_hal::{
Expand Down Expand Up @@ -55,7 +55,7 @@ const APP: () = {
Timer::tim1(cx.device.TIM1, &clocks, &mut rcc.apb2).start_count_down(1.hz());
timer.listen(Event::Update);

// Init the static resources to use them later through RTFM
// Init the static resources to use them later through RTIC
init::LateResources {
led,
timer_handler: timer,
Expand All @@ -64,7 +64,7 @@ const APP: () = {

// Optional.
//
// https://rtfm.rs/0.5/book/en/by-example/app.html#idle
// https://rtic.rs/0.5/book/en/by-example/app.html#idle
// > When no idle function is declared, the runtime sets the SLEEPONEXIT bit and then
// > sends the microcontroller to sleep after running init.
#[idle]
Expand All @@ -84,7 +84,7 @@ const APP: () = {
static mut COUNT: u8 = 0;

if *cx.resources.led_state {
// Uses resources managed by rtfm to turn led off (on bluepill)
// Uses resources managed by rtic to turn led off (on bluepill)
cx.resources.led.set_high().unwrap();
*cx.resources.led_state = false;
} else {
Expand Down
4 changes: 2 additions & 2 deletions examples/usb_serial_rtfm.rs → examples/usb_serial_rtic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! CDC-ACM serial port example using cortex-m-rtfm.
//! CDC-ACM serial port example using cortex-m-rtic.
//! Target board: Blue Pill
#![no_main]
#![no_std]
Expand All @@ -8,7 +8,7 @@ extern crate panic_semihosting;

use cortex_m::asm::delay;
use embedded_hal::digital::v2::OutputPin;
use rtfm::app;
use rtic::app;
use stm32f1xx_hal::prelude::*;
use stm32f1xx_hal::usb::{Peripheral, UsbBus, UsbBusType};
use usb_device::bus;
Expand Down