compile ethmac driver

This commit is contained in:
Sebastien Bourdeauducq 2017-08-02 00:33:33 +08:00
parent 0ab3b6116e
commit 98f116e226
4 changed files with 33 additions and 2 deletions

23
firmware/Cargo.lock generated
View File

@ -4,9 +4,15 @@ version = "0.1.0"
dependencies = [
"cortex-m 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
"cortex-m-rt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=6bc6cc7)",
"tm4c129x 0.4.0 (git+https://github.com/m-labs/dslite2svd)",
]
[[package]]
name = "byteorder"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cortex-m"
version = "0.2.5"
@ -29,11 +35,25 @@ name = "cortex-m-semihosting"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "managed"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "r0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "smoltcp"
version = "0.4.0-pre"
source = "git+https://github.com/m-labs/smoltcp?rev=6bc6cc7#6bc6cc7af7ab7b710e9238b3c34bd50425ed7a92"
dependencies = [
"byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"managed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tm4c129x"
version = "0.4.0"
@ -57,10 +77,13 @@ dependencies = [
]
[metadata]
"checksum byteorder 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff81738b726f5d099632ceaffe7fb65b90212e8dce59d518729e7e8634032d3d"
"checksum cortex-m 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "56f002db38ab2c7a829bc0b997db8c5f47ada08f88a248c729d4f73c555628db"
"checksum cortex-m-rt 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0db3cf185ad88e3d70e9b7738d1bad23f86322130d376df9b80a64df7abdb4cb"
"checksum cortex-m-semihosting 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "54a88e8fd577808637f819107f34eece1b6b45be8db1c56d1c563095b80b655e"
"checksum managed 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "61eb783b4fa77e8fa4d27ec400f97ed9168546b8b30341a120b7ba9cc6571aaf"
"checksum r0 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6e7bbed8cd0a245bbf3759ebb35c964822b7a8c15ceeeee56d4cc5f060ce518e"
"checksum smoltcp 0.4.0-pre (git+https://github.com/m-labs/smoltcp?rev=6bc6cc7)" = "<none>"
"checksum tm4c129x 0.4.0 (git+https://github.com/m-labs/dslite2svd)" = "<none>"
"checksum vcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "45c297f0afb6928cd08ab1ff9d95e99392595ea25ae1b5ecf822ff8764e57a0d"
"checksum volatile-register 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d67cb4616d99b940db1d6bd28844ff97108b498a6ca850e5b6191a532063286"

View File

@ -8,6 +8,12 @@ cortex-m = "0.2.5"
cortex-m-rt = { version = "0.2.0", features = ["linker-script"], default-features = false }
tm4c129x = { git = "https://github.com/m-labs/dslite2svd" }
[dependencies.smoltcp]
git = "https://github.com/m-labs/smoltcp"
rev = "6bc6cc7"
features = []
default-features = false
[profile.release]
lto = true
debug = true

View File

@ -353,7 +353,7 @@ impl Device for EthernetDevice {
limits
}
fn receive(&mut self) -> Result<Self::RxBuffer, Error> {
fn receive(&mut self, _timestamp: u64) -> Result<Self::RxBuffer, Error> {
unsafe {
if 0 == (EMAC_DATA.rx_desc_buf[EMAC_DATA.rx_cur_desc + 0] & EMAC_RDES0_OWN) {
// check for the whole packet in the buffer and no any error
@ -375,7 +375,7 @@ impl Device for EthernetDevice {
}
}
fn transmit(&mut self, length: usize) -> Result<Self::TxBuffer, Error> {
fn transmit(&mut self, _timestamp: u64, length: usize) -> Result<Self::TxBuffer, Error> {
unsafe {
// Check if the TX DMA buffer released
if 0 == (EMAC_DATA.tx_desc_buf[EMAC_DATA.tx_cur_desc + 0] & EMAC_TDES0_OWN) {

View File

@ -4,6 +4,7 @@
extern crate cortex_m;
extern crate cortex_m_rt;
extern crate tm4c129x;
extern crate smoltcp;
use core::cell::{Cell, RefCell};
use core::fmt;
@ -28,6 +29,7 @@ macro_rules! println {
#[macro_use]
mod board;
mod ethmac;
mod pid;
mod loop_anode;
mod loop_cathode;