Skip to content

Commit fa6eb8a

Browse files
bors[bot]burrbull
andauthored
Merge #389
389: fix deprecation & clippy warnings r=therealprof a=burrbull Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents ecd81e0 + 45f04e3 commit fa6eb8a

28 files changed

+49
-31
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ features = ["stm32f103", "rt"]
1616
default-target = "x86_64-unknown-linux-gnu"
1717

1818
[dependencies]
19-
cortex-m = "0.7"
19+
cortex-m = "0.7.4"
2020
cortex-m-rt = "0.7"
2121
nb = "1"
2222
stm32f1 = "0.14.0"

examples/adc-dma-circ.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! ADC interface circular DMA RX transfer test
22
3+
#![allow(clippy::empty_loop)]
34
#![no_main]
45
#![no_std]
56

examples/adc-dma-rx.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! ADC interface DMA RX transfer test
22
3+
#![allow(clippy::empty_loop)]
34
#![no_main]
45
#![no_std]
56

examples/blinky_rtcalarm_irq.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
//! GPIOs PC13 to PC15 in output mode is restricted: the speed has to be limited to 2MHz with
88
//! a maximum load of 30pF and these IOs must not be used as a current source (e.g. to drive a LED)"
99
10+
#![allow(clippy::empty_loop)]
11+
#![allow(unused)]
1012
#![no_std]
1113
#![no_main]
1214

@@ -26,10 +28,10 @@ use cortex_m::{asm::wfi, interrupt::Mutex};
2628
use cortex_m_rt::entry;
2729

2830
// A type definition for the GPIO pin to be used for our LED
29-
type LEDPIN = gpioc::PC13<Output<PushPull>>;
31+
type LedPin = gpioc::PC13<Output<PushPull>>;
3032

3133
// Make LED pin globally available
32-
static G_LED: Mutex<RefCell<Option<LEDPIN>>> = Mutex::new(RefCell::new(None));
34+
static G_LED: Mutex<RefCell<Option<LedPin>>> = Mutex::new(RefCell::new(None));
3335
// Make RTC globally available
3436
static G_RTC: Mutex<RefCell<Option<Rtc>>> = Mutex::new(RefCell::new(None));
3537
// Make EXTI registers globally available
@@ -50,7 +52,7 @@ fn main() -> ! {
5052
#[cfg(not(feature = "stm32f101"))]
5153
#[interrupt]
5254
fn RTCALARM() {
53-
static mut LED: Option<LEDPIN> = None;
55+
static mut LED: Option<LedPin> = None;
5456
static mut RTC: Option<Rtc> = None;
5557
static mut EXTI: Option<EXTI> = None;
5658

examples/blinky_timer_irq.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ use cortex_m_rt::entry;
3232
//use cortex_m_semihosting::hprintln;
3333

3434
// A type definition for the GPIO pin to be used for our LED
35-
type LEDPIN = gpioc::PC13<Output<PushPull>>;
35+
type LedPin = gpioc::PC13<Output<PushPull>>;
3636

3737
// Make LED pin globally available
38-
static G_LED: Mutex<RefCell<Option<LEDPIN>>> = Mutex::new(RefCell::new(None));
38+
static G_LED: Mutex<RefCell<Option<LedPin>>> = Mutex::new(RefCell::new(None));
3939

4040
// Make timer interrupt registers globally available
4141
static G_TIM: Mutex<RefCell<Option<CountDownTimer<TIM2>>>> = Mutex::new(RefCell::new(None));
@@ -44,7 +44,7 @@ static G_TIM: Mutex<RefCell<Option<CountDownTimer<TIM2>>>> = Mutex::new(RefCell:
4444
// This specific interrupt will "trip" when the timer TIM2 times out
4545
#[interrupt]
4646
fn TIM2() {
47-
static mut LED: Option<LEDPIN> = None;
47+
static mut LED: Option<LedPin> = None;
4848
static mut TIM: Option<CountDownTimer<TIM2>> = None;
4949

5050
let led = LED.get_or_insert_with(|| {

examples/crc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! CRC calculation
22
33
#![deny(unsafe_code)]
4+
#![allow(clippy::empty_loop)]
45
#![no_main]
56
#![no_std]
67

examples/exti.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! Listens for interrupts on the pa7 pin. On any rising or falling edge, toggles
44
//! the pc13 pin (which is connected to the LED on the blue pill board, hence the `led` name).
55
6+
#![allow(clippy::empty_loop)]
67
#![no_main]
78
#![no_std]
89

examples/hello.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Prints "Hello, world" on the OpenOCD console
22
3+
#![allow(clippy::empty_loop)]
34
#![deny(unsafe_code)]
45
#![no_main]
56
#![no_std]

examples/itm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#![deny(unsafe_code)]
2+
#![allow(clippy::empty_loop)]
23
#![no_main]
34
#![no_std]
45

examples/led.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//! section 5.1.2 of the reference manual for an explanation.
1010
//! This is not an issue on the blue pill.
1111
12+
#![allow(clippy::empty_loop)]
1213
#![deny(unsafe_code)]
1314
#![no_main]
1415
#![no_std]

0 commit comments

Comments
 (0)