Browse Source

bump stm32-rs deps (v 0.9) (#134)

* bump stm32-rs deps

* update changelog
Zgarbul Andrey 4 years ago
parent
commit
1312d0f138
5 changed files with 24 additions and 23 deletions
  1. 1 0
      CHANGELOG.md
  2. 1 1
      Cargo.toml
  3. 20 20
      src/adc.rs
  4. 1 1
      src/pwm.rs
  5. 1 1
      src/pwm_input.rs

+ 1 - 0
CHANGELOG.md

@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 
 ### Breaking changes
 
+- Bump `stm32f1` dependency (`0.9.0`)
 - `void::Void` replaced with `Infallible` where it is possible
 - Change timer/pwm init API
 - Remove `set_low` and `set_high` for pins in Alternate output mode

+ 1 - 1
Cargo.toml

@@ -22,7 +22,7 @@ required-features = ["rt"]
 cortex-m = "0.6.0"
 nb = "0.1.2"
 cortex-m-rt = "0.6.8"
-stm32f1 = "0.8.0"
+stm32f1 = "0.9.0"
 as-slice = "0.2"
 
 [dependencies.void]

+ 20 - 20
src/adc.rs

@@ -278,12 +278,12 @@ macro_rules! adc_hal {
                 fn setup_oneshot(&mut self) {
                     self.rb.cr2.modify(|_, w| w.cont().clear_bit());
                     self.rb.cr2.modify(|_, w| w.exttrig().set_bit());
-                    self.rb.cr2.modify(|_, w| unsafe { w.extsel().bits(0b111) });
+                    self.rb.cr2.modify(|_, w| w.extsel().bits(0b111));
 
                     self.rb.cr1.modify(|_, w| w.scan().clear_bit());
                     self.rb.cr1.modify(|_, w| w.discen().set_bit());
 
-                    self.rb.sqr1.modify(|_, w| unsafe { w.l().bits(0b0) });
+                    self.rb.sqr1.modify(|_, w| w.l().bits(0b0) );
                 }
 
                 fn set_chan_smps(&mut self, chan: u8) {
@@ -291,76 +291,76 @@ macro_rules! adc_hal {
                         0 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp0().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp0().bits(self.sample_time.into()) ),
                         1 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp1().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp1().bits(self.sample_time.into()) ),
                         2 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp2().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp2().bits(self.sample_time.into()) ),
                         3 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp3().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp3().bits(self.sample_time.into()) ),
                         4 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp4().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp4().bits(self.sample_time.into()) ),
                         5 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp5().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp5().bits(self.sample_time.into()) ),
                         6 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp6().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp6().bits(self.sample_time.into()) ),
                         7 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp7().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp7().bits(self.sample_time.into()) ),
                         8 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp8().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp8().bits(self.sample_time.into()) ),
                         9 => self
                             .rb
                             .smpr2
-                            .modify(|_, w| unsafe { w.smp9().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp9().bits(self.sample_time.into()) ),
 
                         10 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp10().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp10().bits(self.sample_time.into()) ),
                         11 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp11().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp11().bits(self.sample_time.into()) ),
                         12 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp12().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp12().bits(self.sample_time.into()) ),
                         13 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp13().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp13().bits(self.sample_time.into()) ),
                         14 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp14().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp14().bits(self.sample_time.into()) ),
                         15 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp15().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp15().bits(self.sample_time.into()) ),
                         16 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp16().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp16().bits(self.sample_time.into()) ),
                         17 => self
                             .rb
                             .smpr1
-                            .modify(|_, w| unsafe { w.smp17().bits(self.sample_time.into()) }),
+                            .modify(|_, w| w.smp17().bits(self.sample_time.into()) ),
                         _ => unreachable!(),
                     }
 

+ 1 - 1
src/pwm.rs

@@ -313,7 +313,7 @@ macro_rules! hal {
                         .set_bit()
                 );
 
-                unsafe { mem::uninitialized() }
+                unsafe { mem::MaybeUninit::uninit().assume_init() }
             }
 
             impl hal::PwmPin for Pwm<$TIMX, C1> {

+ 1 - 1
src/pwm_input.rs

@@ -231,7 +231,7 @@ macro_rules! hal {
             tim.cr1.modify(|_,w| w.cen().set_bit());
 
 
-            unsafe { mem::uninitialized() }
+            unsafe { mem::MaybeUninit::uninit().assume_init() }
          }
 
       impl<PINS> PwmInput<$TIMX,PINS> where PINS : Pins<$TIMX> {