Skip to content

Commit 470e0a5

Browse files
committed
Pass HAL peripherals struct to main
1 parent ee92fb4 commit 470e0a5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use smoltcp::socket::{UdpPacketMetadata, UdpSocket, UdpSocketBuffer};
2323
use smoltcp::time::Instant;
2424
use smoltcp::wire::{EthernetAddress, IpAddress, IpEndpoint, Ipv4Address};
2525
use stm32f7::{audio, board, embedded, ethernet, i2c, lcd, sd, sdram, system_clock, touch};
26+
use hal::stm32f7::stm32f7x6::Peripherals;
2627

2728
pub const ETH_ADDR: EthernetAddress = EthernetAddress([0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef]);
2829
pub const IP_ADDR: Ipv4Address = Ipv4Address([141, 52, 46, 198]);
@@ -50,12 +51,12 @@ pub unsafe extern "C" fn reset() -> ! {
5051
scb.cpacr.modify(|v| v | 0b1111 << 20);
5152
asm!("DSB; ISB;"::::"volatile"); // pipeline flush
5253

53-
main(board::hw());
54+
main(board::hw(), hal::take_peripherals().unwrap());
5455
}
5556

5657
// WORKAROUND: rust compiler will inline & reorder fp instructions into
5758
#[inline(never)] // reset() before the FPU is initialized
58-
fn main(hw: board::Hardware) -> ! {
59+
fn main(hw: board::Hardware, peripherals: Peripherals) -> ! {
5960
use alloc::Vec;
6061
use embedded::interfaces::gpio::{self, Gpio};
6162

0 commit comments

Comments
 (0)