3 ms·
fn read_keys(port: #[cfg(feature = "splitapple")] nrf52840_hal::pac::P1 #[cfg(feature = "keytron")] nrf
by leshow 6y ago
fn read_keys(port: #[cfg(feature = "splitapple")]
nrf52840_hal::pac::P1
#[cfg(feature = "keytron")]
nrf52833_hal::pac::P0) -> Packet {}
I'm not sure why you'd choose to write it this way? Should this not be a trait that provides the read_keys method and you have a type that exists for each of your target architectures?
Nevermind that you could actually do this, although you probably shouldn't
fn read_keys(#[cfg(feature = "splitapple")]
port: nrf52840_hal::pac::P1
#[cfg(feature = "keytron")]
port: nrf52833_hal::pac::P0) -> Packet {}