diff options
| author | Dario Nieuwenhuis <[email protected]> | 2021-08-02 12:40:01 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2021-08-02 19:55:04 +0200 |
| commit | 63ac7ac799b07c18a9a621b4d20ead2b39982ef5 (patch) | |
| tree | 714ed050cb55ef90bfa2d3a94e9318e8e2acc724 /examples | |
| parent | af87031d62ca9ee5e7dd44cba297f3d171ec0708 (diff) | |
Mark `new`s as unsafe due to not being leak-safe.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/stm32h7/src/bin/eth.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/stm32h7/src/bin/eth.rs b/examples/stm32h7/src/bin/eth.rs index 5cf49e82f..e49a101bf 100644 --- a/examples/stm32h7/src/bin/eth.rs +++ b/examples/stm32h7/src/bin/eth.rs | |||
| @@ -135,10 +135,12 @@ fn main() -> ! { | |||
| 135 | let eth_int = interrupt_take!(ETH); | 135 | let eth_int = interrupt_take!(ETH); |
| 136 | let mac_addr = [0x10; 6]; | 136 | let mac_addr = [0x10; 6]; |
| 137 | let state = STATE.put(State::new()); | 137 | let state = STATE.put(State::new()); |
| 138 | let eth = ETH.put(Ethernet::new( | 138 | let eth = unsafe { |
| 139 | state, p.ETH, eth_int, p.PA1, p.PA2, p.PC1, p.PA7, p.PC4, p.PC5, p.PB12, p.PB13, p.PB11, | 139 | ETH.put(Ethernet::new( |
| 140 | LAN8742A, mac_addr, 1, | 140 | state, p.ETH, eth_int, p.PA1, p.PA2, p.PC1, p.PA7, p.PC4, p.PC5, p.PB12, p.PB13, |
| 141 | )); | 141 | p.PB11, LAN8742A, mac_addr, 1, |
| 142 | )) | ||
| 143 | }; | ||
| 142 | 144 | ||
| 143 | let config = StaticConfigurator::new(NetConfig { | 145 | let config = StaticConfigurator::new(NetConfig { |
| 144 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 0, 61), 24), | 146 | address: Ipv4Cidr::new(Ipv4Address::new(192, 168, 0, 61), 24), |
