Skip to content

Commit

Permalink
Merge pull request #750 from quartiq/dependabot/cargo/stm32h7xx-hal-1…
Browse files Browse the repository at this point in the history
…1c5eba

build(deps): bump stm32h7xx-hal from `2d47a4a` to `11c5eba`
  • Loading branch information
ryan-summers authored Jul 21, 2023
2 parents 3eadf73 + 581fc99 commit e62046a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ rand_xorshift = "0.3.0"
rand_core = "0.6.4"
minimq = "0.7"
miniconf = "0.7"
smoltcp-nal = { version = "0.3", features = ["shared-stack"]}
smoltcp-nal = { version = "0.4", features = ["shared-stack"]}

[dependencies.stm32h7xx-hal]
git = "https://github.com/stm32-rs/stm32h7xx-hal"
Expand Down
32 changes: 16 additions & 16 deletions src/hardware/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,21 @@ pub struct NetStorage {
pub struct UdpSocketStorage {
rx_storage: [u8; 1024],
tx_storage: [u8; 2048],
tx_metadata:
[smoltcp::storage::PacketMetadata<smoltcp::wire::IpEndpoint>; 10],
rx_metadata:
[smoltcp::storage::PacketMetadata<smoltcp::wire::IpEndpoint>; 10],
tx_metadata: [smoltcp::storage::PacketMetadata<
smoltcp::socket::udp::UdpMetadata,
>; 10],
rx_metadata: [smoltcp::storage::PacketMetadata<
smoltcp::socket::udp::UdpMetadata,
>; 10],
}

impl UdpSocketStorage {
const fn new() -> Self {
Self {
rx_storage: [0; 1024],
tx_storage: [0; 2048],
tx_metadata: [smoltcp::storage::PacketMetadata::<
smoltcp::wire::IpEndpoint,
>::EMPTY; 10],
rx_metadata: [smoltcp::storage::PacketMetadata::<
smoltcp::wire::IpEndpoint,
>::EMPTY; 10],
tx_metadata: [smoltcp::storage::PacketMetadata::EMPTY; 10],
rx_metadata: [smoltcp::storage::PacketMetadata::EMPTY; 10],
}
}
}
Expand Down Expand Up @@ -653,14 +651,16 @@ pub fn setup(

store.ip_addrs[0] = smoltcp::wire::IpCidr::new(ip_addrs, 24);

let mut ethernet_config = smoltcp::iface::Config::default();
ethernet_config
.hardware_addr
.replace(smoltcp::wire::HardwareAddress::Ethernet(mac_addr));
let mut ethernet_config = smoltcp::iface::Config::new(
smoltcp::wire::HardwareAddress::Ethernet(mac_addr),
);
ethernet_config.random_seed = u64::from_be_bytes(random_seed);

let mut interface =
smoltcp::iface::Interface::new(ethernet_config, &mut eth_dma);
let mut interface = smoltcp::iface::Interface::new(
ethernet_config,
&mut eth_dma,
smoltcp::time::Instant::ZERO,
);

interface
.routes_mut()
Expand Down

0 comments on commit e62046a

Please sign in to comment.