Small adjustment to 'set_as_af' interface

Small adjustment to 'set_as_af' interface - v2
This commit is contained in:
Mariusz Ryndzionek
2021-09-24 18:39:07 +02:00
parent b6fc19182b
commit d371298a27
7 changed files with 45 additions and 25 deletions

View File

@ -9,8 +9,8 @@ use embassy_hal_common::unborrow;
use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU};
use crate::gpio::sealed::Pin as __GpioPin;
use crate::gpio::AnyPin;
use crate::gpio::Pin as GpioPin;
use crate::gpio::{AnyPin, OutputType::PushPull};
use crate::pac::gpio::vals::Ospeedr;
use crate::pac::{ETH, RCC, SYSCFG};
use crate::peripherals;
@ -416,7 +416,7 @@ macro_rules! impl_pin {
fn configure(&mut self) {
// NOTE(unsafe) Exclusive access to the registers
critical_section::with(|_| unsafe {
self.set_as_af($af);
self.set_as_af($af, PushPull);
self.block()
.ospeedr()
.modify(|w| w.set_ospeedr(self.pin() as usize, Ospeedr::VERYHIGHSPEED));