فهرست منبع

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

Diego Barrios Romero 3 سال پیش
والد
کامیت
68fd3d6f28
5فایلهای تغییر یافته به همراه13 افزوده شده و 10 حذف شده
  1. 3 0
      CHANGELOG.md
  2. 3 3
      Cargo.toml
  3. 1 1
      examples/exti.rs
  4. 4 4
      examples/timer-interrupt-rtic.rs
  5. 2 2
      examples/usb_serial_rtic.rs

+ 3 - 0
CHANGELOG.md

@@ -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

+ 3 - 3
Cargo.toml

@@ -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"
@@ -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]]
@@ -125,7 +125,7 @@ name = "qei"
 required-features = ["medium"]
 
 [[example]]
-name = "timer-interrupt-rtfm"
+name = "timer-interrupt-rtic"
 required-features = ["rt", "medium"]
 
 [[example]]

+ 1 - 1
examples/exti.rs

@@ -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>>> =

+ 4 - 4
examples/timer-interrupt-rtfm.rs → examples/timer-interrupt-rtic.rs

@@ -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::{
@@ -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,
@@ -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]
@@ -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 {

+ 2 - 2
examples/usb_serial_rtfm.rs → examples/usb_serial_rtic.rs

@@ -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]
@@ -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;