remove unused code, deny warnings

This commit is contained in:
Robert Jördens 2019-11-11 12:04:50 +01:00
parent c52172f753
commit 0b4f7c9201
5 changed files with 3 additions and 72 deletions

View File

@ -8,16 +8,3 @@ pub fn read_eui48<'a>(i2c: &pac::I2C2) -> Result<[u8; 6], i2c::Error> {
i2c::write_read(i2c, I2C_ADDR, &[0xFAu8], &mut buffer)?;
Ok(buffer)
}
pub fn read(i2c: &pac::I2C2, addr: u8, mut buffer: &mut [u8]) -> Result<(), i2c::Error> {
i2c::write_read(i2c, I2C_ADDR, &[addr], &mut buffer)?;
Ok(())
}
pub fn write(i2c: &pac::I2C2, addr: u8, buffer: &[u8]) -> Result<(), i2c::Error> {
for (i, &byte) in buffer.iter().enumerate() {
i2c::write(i2c, I2C_ADDR, &[addr+i as u8, byte])?;
}
Ok(())
}

View File

@ -557,21 +557,3 @@ impl<'a> phy::TxToken for TxToken<'a> {
result
}
}
pub unsafe fn interrupt_handler(eth_dma: &pac::ETHERNET_DMA) {
eth_dma.dmacsr.write(|w|
w
.nis().set_bit()
.ri().set_bit()
.ti().set_bit()
);
}
pub unsafe fn enable_interrupt(eth_dma: &pac::ETHERNET_DMA) {
eth_dma.dmacier.modify(|_, w|
w
.nie().set_bit()
.rie().set_bit()
.tie().set_bit()
);
}

View File

@ -109,25 +109,6 @@ fn poll_for_start_ack(
}
pub fn write(
i2c: &pac::I2C2,
addr: u8,
bytes: &[u8]
) -> Result<(), Error> {
assert!(bytes.len() < 256 && bytes.len() > 0);
poll_for_start_ack(i2c, addr|0, false, bytes.len(), true, true)?;
for byte in bytes {
busy_wait_errors!(i2c, txis);
i2c.txdr.write(|w| w.txdata().bits(*byte));
}
// automatic STOP
Ok(())
}
pub fn write_read(
i2c: &pac::I2C2,
addr: u8,
@ -160,23 +141,3 @@ pub fn write_read(
// automatic STOP
Ok(())
}
pub fn read(
i2c: &pac::I2C2,
addr: u8,
buffer: &mut [u8],
) -> Result<(), Error> {
assert!(buffer.len() < 256 && buffer.len() > 0);
poll_for_start_ack(i2c, addr|0, true, buffer.len(), true, true)?;
for byte in buffer {
// Wait until we have received something
busy_wait_errors!(i2c, rxne);
*byte = i2c.rxdr.read().rxdata().bits();
}
// automatic STOP
Ok(())
}

View File

@ -39,7 +39,6 @@ fn macc<T>(y0: T, x: &[T], a: &[T]) -> T
x.iter().zip(a.iter()).map(|(&i, &j)| i * j).fold(y0, |y, xa| y + xa)
}
#[allow(unused)]
impl IIR {
pub fn set_pi(&mut self, kp: f32, ki: f32, g: f32) -> Result<(), &str> {
let ki = copysign(ki, kp);

View File

@ -1,3 +1,5 @@
#![deny(warnings)]
#![no_std]
#![no_main]
#![cfg_attr(feature = "nightly", feature(asm))]
@ -41,7 +43,7 @@ mod eth;
mod iir;
use iir::*;
pub mod i2c;
mod i2c;
mod eeprom;
#[cfg(not(feature = "semihosting"))]