Browse Source

Rename free to release and deprecate free

TheZoq2 4 years ago
parent
commit
ae870eb7d8
2 changed files with 6 additions and 0 deletions
  1. 2 0
      CHANGELOG.md
  2. 4 0
      src/spi.rs

+ 2 - 0
CHANGELOG.md

@@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
 ### Changed
 
 - Use `Deref` for I2C generic implementations instead of macros
+- Deprecate `Spi::free` and rename it to `Spi::release`
+- Improve `SPI` documentation
 
 ## [v0.6.0] - 2020-06-06
 

+ 4 - 0
src/spi.rs

@@ -303,9 +303,13 @@ where
         }
     }
 
+    #[deprecated(since = "0.6.0", note = "Please use release instead")]
     pub fn free(self) -> (SPI, PINS) {
         (self.spi, self.pins)
     }
+    pub fn release(self) -> (SPI, PINS) {
+        self.free()
+    }
 }
 
 impl<SPI, REMAP, PINS> crate::hal::spi::FullDuplex<u8> for Spi<SPI, REMAP, PINS>