From b2be3f950c5a6493baa5a39fb6022c5b37acb1f5 Mon Sep 17 00:00:00 2001 From: Rahix Date: Sun, 11 Feb 2024 11:25:46 +0100 Subject: [PATCH] atmega-hal: Drop redundant atmega8 macro invocation Consolidate the macro invocation for ATmega8 SPI into the existing invocation with the same parameters. Co-developed-by: Ghislain MARY --- mcu/atmega-hal/src/spi.rs | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/mcu/atmega-hal/src/spi.rs b/mcu/atmega-hal/src/spi.rs index ae72c08528..62c7988011 100644 --- a/mcu/atmega-hal/src/spi.rs +++ b/mcu/atmega-hal/src/spi.rs @@ -2,7 +2,12 @@ use crate::port; pub use avr_hal_generic::spi::*; -#[cfg(any(feature = "atmega128a", feature = "atmega1280", feature = "atmega2560", feature = "atmega32u4"))] +#[cfg(any( + feature = "atmega128a", + feature = "atmega1280", + feature = "atmega2560", + feature = "atmega32u4" +))] pub type Spi = avr_hal_generic::spi::Spi< crate::Atmega, crate::pac::SPI, @@ -11,7 +16,12 @@ pub type Spi = avr_hal_generic::spi::Spi< port::PB3, port::PB0, >; -#[cfg(any(feature = "atmega128a", feature = "atmega1280", feature = "atmega2560", feature = "atmega32u4"))] +#[cfg(any( + feature = "atmega128a", + feature = "atmega1280", + feature = "atmega2560", + feature = "atmega32u4" +))] avr_hal_generic::impl_spi! { hal: crate::Atmega, peripheral: crate::pac::SPI, @@ -21,7 +31,12 @@ avr_hal_generic::impl_spi! { cs: port::PB0, } -#[cfg(any(feature = "atmega168", feature = "atmega328p", feature = "atmega48p",))] +#[cfg(any( + feature = "atmega168", + feature = "atmega328p", + feature = "atmega48p", + feature = "atmega8" +))] pub type Spi = avr_hal_generic::spi::Spi< crate::Atmega, crate::pac::SPI, @@ -30,7 +45,12 @@ pub type Spi = avr_hal_generic::spi::Spi< port::PB4, port::PB2, >; -#[cfg(any(feature = "atmega168", feature = "atmega328p", feature = "atmega48p",))] +#[cfg(any( + feature = "atmega168", + feature = "atmega328p", + feature = "atmega48p", + feature = "atmega8" +))] avr_hal_generic::impl_spi! { hal: crate::Atmega, peripheral: crate::pac::SPI, @@ -95,13 +115,3 @@ avr_hal_generic::impl_spi! { miso: port::PB6, cs: port::PB4, } - -#[cfg(any(feature = "atmega8"))] -avr_hal_generic::impl_spi! { - hal: crate::Atmega, - peripheral: crate::pac::SPI, - sclk: port::PB5, - mosi: port::PB3, - miso: port::PB4, - cs: port::PB2, -}