Skip to content

Commit d4d70ac

Browse files
committed
Fix warnings
1 parent c07de3d commit d4d70ac

File tree

4 files changed

+15
-33
lines changed

4 files changed

+15
-33
lines changed

src/future_mutex.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
use spin::{Mutex, MutexGuard};
1+
use spin::Mutex;
22
use core::{
33
future::Future,
4-
sync::atomic::AtomicBool,
54
pin::{Pin, Unpin},
65
mem,
76
};
8-
use alloc::{
9-
prelude::*,
10-
sync::Arc,
11-
task::{Wake, LocalWaker, local_waker_from_nonlocal},
12-
collections::{BTreeMap, BTreeSet},
13-
};
14-
use futures::{
15-
prelude::*,
16-
future::{FutureObj, LocalFutureObj, UnsafeFutureObj},
17-
task::{Poll, Spawn, LocalSpawn, SpawnError},
18-
channel::mpsc,
19-
};
7+
use alloc::task::LocalWaker;
8+
use futures::task::Poll;
209
use crate::mpsc_queue::{Queue, PopResult};
2110

2211
pub struct FutureMutex<T> {
@@ -60,7 +49,7 @@ impl<'a, T, R, F> Future for FutureMutexResult<'a, T, R, F> where F: FnOnce(&mut
6049
Poll::Pending
6150
},
6251
Some(mut guard) => {
63-
let mut f = self.f.take().unwrap();
52+
let f = self.f.take().unwrap();
6453
let ret = f(&mut guard);
6554
loop {
6655
match self.waker_queue.pop() {

src/lcd/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub use self::stdout::init as init_stdout;
55
use core::{fmt, ptr};
66
use stm32f7::stm32f7x6::LTDC;
77
use alloc::sync::Arc;
8-
use futures::Future;
98
use crate::future_mutex::FutureMutex;
109

1110
#[macro_use]

src/main.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ use smoltcp::{
3838
time::Instant,
3939
wire::{EthernetAddress, IpAddress, IpEndpoint, Ipv4Address},
4040
};
41-
use stm32f7::stm32f7x6::{self, CorePeripherals, Interrupt, Peripherals, SAI2};
41+
use stm32f7::stm32f7x6::{CorePeripherals, Interrupt, Peripherals, SAI2};
4242
use stm32f7_discovery::{
4343
ethernet,
4444
gpio::{GpioPort, InputPin, OutputPin},
@@ -53,15 +53,9 @@ use stm32f7_discovery::{
5353
future_mutex::FutureMutex,
5454
i2c::I2C,
5555
};
56-
use core::ops::{Generator, GeneratorState};
57-
use core::future::Future;
5856
use futures::{Stream, StreamExt};
5957
use pin_utils::pin_mut;
60-
use spin::Mutex;
6158
use alloc::sync::Arc;
62-
use alloc::collections::VecDeque;
63-
use core::task::{Poll, LocalWaker};
64-
use core::pin::Pin;
6559

6660
#[global_allocator]
6761
static ALLOCATOR: CortexMHeap = CortexMHeap::empty();
@@ -94,7 +88,7 @@ fn run() -> ! {
9488
let mut ethernet_dma = peripherals.ETHERNET_DMA;
9589
let mut nvic_stir = peripherals.NVIC_STIR;
9690
let mut tim6 = peripherals.TIM6;
97-
let mut exti = peripherals.EXTI;
91+
let exti = peripherals.EXTI;
9892

9993
init::init_system_clock_216mhz(&mut rcc, &mut pwr, &mut flash);
10094
init::enable_gpio_ports(&mut rcc);
@@ -128,7 +122,7 @@ fn run() -> ! {
128122
unsafe { ALLOCATOR.init(rt::heap_start() as usize, HEAP_SIZE) }
129123

130124
lcd.set_background_color(Color::from_hex(0x006600));
131-
let mut layer_1 = lcd.layer_1().unwrap();
125+
let layer_1 = lcd.layer_1().unwrap();
132126
let mut layer_2 = lcd.layer_2().unwrap();
133127

134128
layer_2.clear();
@@ -137,7 +131,7 @@ fn run() -> ! {
137131
println!("Hello World");
138132

139133

140-
let xs = vec![1, 2, 3];
134+
let _xs = vec![1, 2, 3];
141135

142136
let mut i2c_3 = init::init_i2c_3(Box::leak(Box::new(peripherals.I2C3)), &mut rcc);
143137
i2c_3.test_1();
@@ -192,9 +186,9 @@ fn run() -> ! {
192186
};
193187

194188
let (idle_waker_sink, mut idle_waker_stream) = mpsc::unbounded();
195-
let (tim6_sink, mut tim6_stream) = mpsc::unbounded();
196-
let (button_sink, mut button_stream) = mpsc::unbounded();
197-
let (touch_int_sink, mut touch_int_stream) = mpsc::unbounded();
189+
let (tim6_sink, tim6_stream) = mpsc::unbounded();
190+
let (button_sink, button_stream) = mpsc::unbounded();
191+
let (touch_int_sink, touch_int_stream) = mpsc::unbounded();
198192

199193
interrupt_table.register(InterruptRequest::TIM6_DAC, Priority::P1, move || {
200194
tim6_sink.unbounded_send(()).expect("sending on tim6 channel failed");
@@ -252,7 +246,7 @@ fn run() -> ! {
252246

253247
// ethernet
254248
let mut ethernet_task_idle_stream = task_runtime::IdleStream::new(idle_waker_sink.clone());
255-
let ethernet_task = async move || {
249+
let _ethernet_task = async move || {
256250
let mut ethernet_interface = ethernet::EthernetDevice::new(
257251
Default::default(),
258252
Default::default(),
@@ -328,7 +322,7 @@ fn run() -> ! {
328322
//executor.spawn_local(ethernet_task).unwrap();
329323
//executor.spawn_local(print_x);
330324

331-
let mut idle = async move {
325+
let idle = async move {
332326
loop {
333327
let next_waker = await!(idle_waker_stream.next()).expect("idle channel closed");
334328
next_waker.wake();

src/task_runtime.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use alloc::{
44
prelude::*,
55
sync::Arc,
66
task::{Wake, LocalWaker, local_waker_from_nonlocal},
7-
collections::{BTreeMap, BTreeSet},
7+
collections::BTreeMap,
88
};
99
use futures::{
1010
prelude::*,
11-
future::{FutureObj, LocalFutureObj, UnsafeFutureObj},
11+
future::{FutureObj, LocalFutureObj},
1212
task::{Poll, Spawn, LocalSpawn, SpawnError},
1313
channel::mpsc,
1414
};

0 commit comments

Comments
 (0)