From 8df40ad2609ca437b6dbada1978220b7536b47e6 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio <jorge@japaric.io> Date: Wed, 20 Sep 2017 19:51:31 +0200 Subject: [PATCH] rename led::Green to led::PC13 closes #22 --- examples/blinky-blocking.rs | 6 +++--- examples/blinky.rs | 6 +++--- examples/concurrent.rs | 6 +++--- examples/led.rs | 4 ++-- examples/preemption.rs | 6 +++--- examples/sharing.rs | 6 +++--- examples/wait1.rs | 6 +++--- examples/wait2.rs | 6 +++--- examples/wait3.rs | 6 +++--- examples/wait4.rs | 6 +++--- src/led.rs | 8 ++++---- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/examples/blinky-blocking.rs b/examples/blinky-blocking.rs index 50dd312..8c529f9 100644 --- a/examples/blinky-blocking.rs +++ b/examples/blinky-blocking.rs @@ -14,7 +14,7 @@ extern crate cortex_m_rtfm as rtfm; extern crate nb; use blue_pill::Timer; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::time::Hertz; use rtfm::{app, Threshold}; @@ -48,9 +48,9 @@ fn idle(_t: &mut Threshold, r: idle::Resources) -> ! { state = !state; if state { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } } diff --git a/examples/blinky.rs b/examples/blinky.rs index 4020fae..cfd02d8 100644 --- a/examples/blinky.rs +++ b/examples/blinky.rs @@ -8,7 +8,7 @@ extern crate blue_pill; extern crate cortex_m; extern crate cortex_m_rtfm as rtfm; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use cortex_m::peripheral::SystClkSource; use rtfm::{app, Threshold}; @@ -48,8 +48,8 @@ fn toggle(_t: &mut Threshold, r: SYS_TICK::Resources) { **r.ON = !**r.ON; if **r.ON { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } diff --git a/examples/concurrent.rs b/examples/concurrent.rs index 10abc90..d0ea6f1 100644 --- a/examples/concurrent.rs +++ b/examples/concurrent.rs @@ -9,7 +9,7 @@ extern crate cortex_m; extern crate cortex_m_rtfm as rtfm; use blue_pill::Serial; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::serial::Event; use blue_pill::time::Hertz; @@ -69,8 +69,8 @@ fn toggle(_t: &mut Threshold, r: SYS_TICK::Resources) { **r.ON = !**r.ON; if **r.ON { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } diff --git a/examples/led.rs b/examples/led.rs index 64143f4..a8473b7 100644 --- a/examples/led.rs +++ b/examples/led.rs @@ -8,7 +8,7 @@ extern crate blue_pill; extern crate cortex_m_rtfm as rtfm; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use rtfm::app; app! { @@ -20,7 +20,7 @@ fn init(p: init::Peripherals) { } fn idle() -> ! { - Green.on(); + PC13.on(); // Sleep loop { diff --git a/examples/preemption.rs b/examples/preemption.rs index 4423ecd..69bac66 100644 --- a/examples/preemption.rs +++ b/examples/preemption.rs @@ -9,7 +9,7 @@ extern crate cortex_m; extern crate cortex_m_rtfm as rtfm; use blue_pill::Serial; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::serial::Event; use blue_pill::time::Hertz; @@ -79,8 +79,8 @@ fn toggle(t: &mut Threshold, mut r: SYS_TICK::Resources) { **r.ON = !**r.ON; if **r.ON { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } diff --git a/examples/sharing.rs b/examples/sharing.rs index d499c57..dcf0934 100644 --- a/examples/sharing.rs +++ b/examples/sharing.rs @@ -9,7 +9,7 @@ extern crate cortex_m; extern crate cortex_m_rtfm as rtfm; use blue_pill::Serial; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::serial::Event; use blue_pill::time::Hertz; @@ -74,8 +74,8 @@ fn toggle(_t: &mut Threshold, r: SYS_TICK::Resources) { **r.ON = !**r.ON; if **r.ON { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } diff --git a/examples/wait1.rs b/examples/wait1.rs index 21f51c9..0675e3b 100644 --- a/examples/wait1.rs +++ b/examples/wait1.rs @@ -9,7 +9,7 @@ extern crate blue_pill; extern crate cortex_m_rtfm as rtfm; use blue_pill::Timer; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::time::Hertz; use rtfm::{app, Threshold}; @@ -43,9 +43,9 @@ fn idle(_t: &mut Threshold, r: idle::Resources) -> ! { state = !state; if state { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } } diff --git a/examples/wait2.rs b/examples/wait2.rs index 3b23c27..8cfe53a 100644 --- a/examples/wait2.rs +++ b/examples/wait2.rs @@ -9,7 +9,7 @@ extern crate blue_pill; extern crate cortex_m_rtfm as rtfm; use blue_pill::Timer; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::time::Hertz; use rtfm::{app, Threshold}; @@ -42,9 +42,9 @@ fn idle(_t: &mut Threshold, r: idle::Resources) -> ! { state = !state; if state { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } } diff --git a/examples/wait3.rs b/examples/wait3.rs index b5d5c3e..ae367f4 100644 --- a/examples/wait3.rs +++ b/examples/wait3.rs @@ -9,7 +9,7 @@ extern crate blue_pill; extern crate cortex_m_rtfm as rtfm; use blue_pill::Timer; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::time::Hertz; use rtfm::{app, Threshold}; @@ -43,9 +43,9 @@ fn idle(_t: &mut Threshold, r: idle::Resources) -> ! { state = !state; if state { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } } diff --git a/examples/wait4.rs b/examples/wait4.rs index 393f454..94284bb 100644 --- a/examples/wait4.rs +++ b/examples/wait4.rs @@ -9,7 +9,7 @@ extern crate blue_pill; extern crate cortex_m_rtfm as rtfm; use blue_pill::Timer; -use blue_pill::led::{self, Green}; +use blue_pill::led::{self, PC13}; use blue_pill::prelude::*; use blue_pill::time::Hertz; use rtfm::{app, Threshold}; @@ -43,9 +43,9 @@ fn idle(_t: &mut Threshold, r: idle::Resources) -> ! { state = !state; if state { - Green.on(); + PC13.on(); } else { - Green.off(); + PC13.off(); } } } diff --git a/src/led.rs b/src/led.rs index ab7038e..2c6137d 100644 --- a/src/led.rs +++ b/src/led.rs @@ -1,11 +1,11 @@ //! User LEDs //! -//! - Green = PC13 +//! - PC13 use stm32f103xx::{GPIOC, RCC}; -/// Green LED (PC13) -pub struct Green; +/// LED connected to pin PC13 +pub struct PC13; /// Initializes the user LED pub fn init(gpioc: &GPIOC, rcc: &RCC) { @@ -17,7 +17,7 @@ pub fn init(gpioc: &GPIOC, rcc: &RCC) { gpioc.crh.modify(|_, w| w.mode13().output().cnf13().push()); } -impl Green { +impl PC13 { /// Turns the LED on pub fn on(&self) { unsafe { -- GitLab