From bb620c00b171f6005b7d308f1ab78b15ac20f686 Mon Sep 17 00:00:00 2001 From: Liam Kinne Date: Sat, 27 Jul 2024 21:38:40 +1000 Subject: [PATCH 1/3] fix incorrect stm32g4a1 feature flags --- src/can.rs | 2 +- src/dma/stream.rs | 2 +- src/dma/transfer.rs | 2 +- src/pwm.rs | 6 +++--- src/rcc/enable.rs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/can.rs b/src/can.rs index b70eb04d..697df9c4 100644 --- a/src/can.rs +++ b/src/can.rs @@ -141,7 +141,7 @@ mod fdcan1 { feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g4A1", + feature = "stm32g4a1", ))] mod fdcan2 { use super::sealed; diff --git a/src/dma/stream.rs b/src/dma/stream.rs index d166b48e..18dc4085 100644 --- a/src/dma/stream.rs +++ b/src/dma/stream.rs @@ -523,7 +523,7 @@ macro_rules! dma_stream { feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g49a", + feature = "stm32g4a1", ))] dma_stream!( // Note: the field names start from one, unlike the RM where they start from diff --git a/src/dma/transfer.rs b/src/dma/transfer.rs index bf287076..2c0d2f3d 100644 --- a/src/dma/transfer.rs +++ b/src/dma/transfer.rs @@ -707,7 +707,7 @@ transfer_constructor!( feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g49a", + feature = "stm32g4a1", ))] transfer_constructor!( (DMA1, Stream6), diff --git a/src/pwm.rs b/src/pwm.rs index 192902f7..5f27211d 100644 --- a/src/pwm.rs +++ b/src/pwm.rs @@ -181,7 +181,7 @@ use crate::stm32::RCC; feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g4A1" + feature = "stm32g4a1" ))] use crate::stm32::TIM20; #[cfg(any( @@ -874,7 +874,7 @@ pins! { feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g4A1" + feature = "stm32g4a1" ))] pins! { TIM20: @@ -1753,7 +1753,7 @@ tim_pin_hal! { feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g4A1" + feature = "stm32g4a1" ))] tim_pin_hal! { TIM20: (C1, cc1e, cc1p, ccmr1_output, oc1pe, oc1m, ccr1, u16, cc1ne, cc1np), diff --git a/src/rcc/enable.rs b/src/rcc/enable.rs index 82e61c70..4ab3d330 100644 --- a/src/rcc/enable.rs +++ b/src/rcc/enable.rs @@ -152,7 +152,7 @@ bus! { feature = "stm32g483", feature = "stm32g484", feature = "stm32g491", - feature = "stm32g4A1" + feature = "stm32g4a1" ))] bus! { FDCAN2 => (APB1_1, 25), From 7dc2c94c8fa22b8d1dd0b87450940e768294f77d Mon Sep 17 00:00:00 2001 From: Liam Kinne Date: Sun, 28 Jul 2024 02:59:59 +1000 Subject: [PATCH 2/3] fix doc comments --- src/adc.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/adc.rs b/src/adc.rs index 71225b72..2a0b4310 100644 --- a/src/adc.rs +++ b/src/adc.rs @@ -85,7 +85,7 @@ impl Temperature { /// ## Arguments /// * `sample`: ADC sample taken on the [`Temperature`] channel. /// * `vdda`: Analog reference voltage (vref+) when the temperature - /// sample was taken, in volts. + /// sample was taken, in volts. /// * `resolution`: Configured ADC resolution. #[inline(always)] pub fn temperature_to_degrees_centigrade( @@ -110,7 +110,7 @@ impl Temperature { /// ## Arguments /// * `sample`: ADC sample taken on the [`Temperature`] channel. /// * `vdda`: Analog reference voltage (vref+) when the temperature - /// sample was taken, in millivolts. + /// sample was taken, in millivolts. /// * `resolution`: Configured ADC resolution. #[inline(always)] pub fn temperature_to_degrees_centigrade_coarse( @@ -1901,7 +1901,7 @@ macro_rules! adc { /// * `channel` - channel to configure /// * `sequence` - where in the sequence to sample the channel. Also called rank in some STM docs/code /// * `sample_time` - how long to sample for. See datasheet and ref manual to work out how long you need\ - /// to sample for at a given ADC clock frequency + /// to sample for at a given ADC clock frequency pub fn configure_channel(&mut self, _channel: &CHANNEL, sequence: config::Sequence, sample_time: config::SampleTime) where CHANNEL: Channel @@ -2122,6 +2122,7 @@ macro_rules! adc { /// Enables the ADC clock, resets the peripheral (optionally), runs calibration and applies the supplied config /// # Arguments /// * `reset` - should a reset be performed. This is provided because on some devices multiple ADCs share the same common reset + /// /// TODO: fix needing SYST #[inline(always)] fn claim(self, cs: ClockSource, rcc: &Rcc, delay: &mut impl DelayUs, reset: bool) -> Adc { @@ -2407,7 +2408,7 @@ macro_rules! adc { /// * `channel` - channel to configure /// * `sequence` - where in the sequence to sample the channel. Also called rank in some STM docs/code /// * `sample_time` - how long to sample for. See datasheet and ref manual to work out how long you need\ - /// to sample for at a given ADC clock frequency + /// to sample for at a given ADC clock frequency #[inline(always)] pub fn configure_channel(&mut self, channel: &CHANNEL, sequence: config::Sequence, sample_time: config::SampleTime) where From bbc59c455564c670e53857c43116cb3afad0fdfe Mon Sep 17 00:00:00 2001 From: Liam Kinne Date: Sun, 4 Aug 2024 20:57:06 +1000 Subject: [PATCH 3/3] add transmit type args --- examples/utils/logger.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/utils/logger.rs b/examples/utils/logger.rs index 51482bd5..e15d2514 100644 --- a/examples/utils/logger.rs +++ b/examples/utils/logger.rs @@ -33,7 +33,7 @@ cfg_if::cfg_if! { InterruptSync::new( // We must not use Peripherals::steal() here to get an ITM instance, as the // code might expect to be able to call Peripherals::take() later on. - ItmDest::new(core::mem::transmute(())) + ItmDest::new(core::mem::transmute::<(), stm32g4xx_hal::stm32::ITM>(())) ) }, };