Merge branch 'master' into feature/dma-updates

This commit is contained in:
Ryan Summers 2020-11-10 16:55:25 +01:00
commit db3bb511b4
4 changed files with 21 additions and 79 deletions

View File

@ -2,10 +2,9 @@ name: Continuous Integration
on: on:
push: push:
branches: branches: [master, staging, trying]
- staging pull_request:
- trying branches: [master]
- master
env: env:
CARGO_TERM_COLOR: always CARGO_TERM_COLOR: always
@ -42,7 +41,7 @@ jobs:
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
continue-on-error: true continue-on-error: true
with: with:
command: clippy command: clippy
compile: compile:
runs-on: ubuntu-latest runs-on: ubuntu-latest

72
Cargo.lock generated
View File

@ -344,37 +344,12 @@ dependencies = [
"cortex-m-semihosting", "cortex-m-semihosting",
] ]
[[package]]
name = "paste"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45ca20c77d80be666aef2b45486da86238fabe33e38306bd3118fe4af33fa880"
dependencies = [
"paste-impl",
"proc-macro-hack",
]
[[package]] [[package]]
name = "paste" name = "paste"
version = "1.0.2" version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba7ae1a2180ed02ddfdb5ab70c70d596a26dd642e097bb6fe78b1bde8588ed97" checksum = "ba7ae1a2180ed02ddfdb5ab70c70d596a26dd642e097bb6fe78b1bde8588ed97"
[[package]]
name = "paste-impl"
version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d95a7db200b97ef370c8e6de0088252f7e0dfff7d047a28528e47456c0fc98b6"
dependencies = [
"proc-macro-hack",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.24" version = "1.0.24"
@ -478,7 +453,6 @@ checksum = "0fe46639fd2ec79eadf8fe719f237a7a0bd4dac5d957f1ca5bbdbc1c3c39e53a"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"byteorder", "byteorder",
"log",
"managed", "managed",
] ]
@ -503,8 +477,7 @@ dependencies = [
"serde", "serde",
"serde-json-core", "serde-json-core",
"smoltcp", "smoltcp",
"stm32h7-ethernet", "stm32h7xx-hal",
"stm32h7xx-hal 0.8.0",
] ]
[[package]] [[package]]
@ -513,17 +486,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "stm32h7"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9beb5e2a223c82f263c3051bba4614aebc6e98bd40217df3cd8817c83ac7bd8"
dependencies = [
"bare-metal 0.2.5",
"cortex-m",
"vcell",
]
[[package]] [[package]]
name = "stm32h7" name = "stm32h7"
version = "0.12.1" version = "0.12.1"
@ -536,34 +498,6 @@ dependencies = [
"vcell", "vcell",
] ]
[[package]]
name = "stm32h7-ethernet"
version = "0.1.1"
source = "git+https://github.com/quartiq/stm32h7-ethernet.git#cf9b8bb2e1b440d8ada6ac6048f48dc4ed9c269a"
dependencies = [
"cortex-m",
"log",
"smoltcp",
"stm32h7xx-hal 0.5.0",
]
[[package]]
name = "stm32h7xx-hal"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "987c66628f30012ed9a41cc738421c5caece03292c0cc8fd1e99956f122735bd"
dependencies = [
"bare-metal 0.2.5",
"cast",
"cortex-m",
"cortex-m-rt",
"embedded-hal",
"nb 0.1.3",
"paste 0.1.18",
"stm32h7 0.11.0",
"void",
]
[[package]] [[package]]
name = "stm32h7xx-hal" name = "stm32h7xx-hal"
version = "0.8.0" version = "0.8.0"
@ -576,9 +510,9 @@ dependencies = [
"embedded-dma", "embedded-dma",
"embedded-hal", "embedded-hal",
"nb 1.0.0", "nb 1.0.0",
"paste 1.0.2", "paste",
"smoltcp", "smoltcp",
"stm32h7 0.12.1", "stm32h7",
"void", "void",
] ]

View File

@ -52,11 +52,6 @@ default-features = false
[dependencies.ad9959] [dependencies.ad9959]
path = "ad9959" path = "ad9959"
[dependencies.stm32h7-ethernet]
git = "https://github.com/quartiq/stm32h7-ethernet.git"
branch = "master"
features = ["stm32h743v"]
[dependencies.stm32h7xx-hal] [dependencies.stm32h7xx-hal]
features = ["stm32h743v", "rt", "unproven", "ethernet", "quadspi"] features = ["stm32h743v", "rt", "unproven", "ethernet", "quadspi"]
git = "https://github.com/quartiq/stm32h7xx-hal" git = "https://github.com/quartiq/stm32h7xx-hal"

View File

@ -1,3 +1,6 @@
#![deny(warnings)]
// Deprecation warnings are temporarily allowed as the HAL DMA goes through updates.
#![allow(deprecated)]
#![allow(clippy::missing_safety_doc)] #![allow(clippy::missing_safety_doc)]
#![no_std] #![no_std]
#![no_main] #![no_main]
@ -43,7 +46,10 @@ use hal::{
}, },
ethernet::{self, PHY}, ethernet::{self, PHY},
}; };
use smoltcp as net; use smoltcp as net;
use smoltcp::iface::Routes;
use smoltcp::wire::Ipv4Address;
use heapless::{consts::*, String}; use heapless::{consts::*, String};
@ -90,6 +96,7 @@ mod build_info {
pub struct NetStorage { pub struct NetStorage {
ip_addrs: [net::wire::IpCidr; 1], ip_addrs: [net::wire::IpCidr; 1],
neighbor_cache: [Option<(net::wire::IpAddress, net::iface::Neighbor)>; 8], neighbor_cache: [Option<(net::wire::IpAddress, net::iface::Neighbor)>; 8],
routes_storage: [Option<(smoltcp::wire::IpCidr, smoltcp::iface::Route)>; 1],
} }
static mut NET_STORE: NetStorage = NetStorage { static mut NET_STORE: NetStorage = NetStorage {
@ -99,6 +106,8 @@ static mut NET_STORE: NetStorage = NetStorage {
)], )],
neighbor_cache: [None; 8], neighbor_cache: [None; 8],
routes_storage: [None; 1],
}; };
const SCALE: f32 = ((1 << 15) - 1) as f32; const SCALE: f32 = ((1 << 15) - 1) as f32;
@ -664,6 +673,10 @@ const APP: () = {
24, 24,
); );
let default_v4_gw = Ipv4Address::new(10, 0, 16, 1);
let mut routes = Routes::new(&mut store.routes_storage[..]);
routes.add_default_ipv4_route(default_v4_gw).unwrap();
let neighbor_cache = let neighbor_cache =
net::iface::NeighborCache::new(&mut store.neighbor_cache[..]); net::iface::NeighborCache::new(&mut store.neighbor_cache[..]);
@ -671,6 +684,7 @@ const APP: () = {
.ethernet_addr(mac_addr) .ethernet_addr(mac_addr)
.neighbor_cache(neighbor_cache) .neighbor_cache(neighbor_cache)
.ip_addrs(&mut store.ip_addrs[..]) .ip_addrs(&mut store.ip_addrs[..])
.routes(routes)
.finalize(); .finalize();
(interface, lan8742a) (interface, lan8742a)