Skip to content

Commit 1b103a4

Browse files
authored
Merge pull request #606 from stm32-rs/rel
revert release instance changes
2 parents e503981 + 9e33702 commit 1b103a4

File tree

8 files changed

+26
-69
lines changed

8 files changed

+26
-69
lines changed

CHANGELOG.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10-
- Add `lapce` editor settrings [#601]
10+
- Add `lapce` editor settings [#601]
1111
- Use `enum`s for alternate peripheral pins [#594]
1212
- Added missing U(S)ART DMA traits for HAL serial types [#593]
1313
- Improve SPI::new* docs [#587]
@@ -16,6 +16,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1616
- Fix comlementary for independent channels [#599] [#603]
1717
- I2c dma can now use single DMA channel for TX or RX only [#598]
1818

19+
[#585]: https://github.com/stm32-rs/stm32f4xx-hal/pull/585
20+
[#593]: https://github.com/stm32-rs/stm32f4xx-hal/pull/593
21+
[#594]: https://github.com/stm32-rs/stm32f4xx-hal/pull/594
22+
[#595]: https://github.com/stm32-rs/stm32f4xx-hal/pull/595
23+
[#598]: https://github.com/stm32-rs/stm32f4xx-hal/pull/598
24+
[#599]: https://github.com/stm32-rs/stm32f4xx-hal/pull/599
25+
[#601]: https://github.com/stm32-rs/stm32f4xx-hal/pull/601
26+
[#603]: https://github.com/stm32-rs/stm32f4xx-hal/pull/603
27+
1928
## [v0.15.0] - 2023-03-13
2029

2130
### Changed
@@ -49,11 +58,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
4958
[#577]: https://github.com/stm32-rs/stm32f4xx-hal/pull/577
5059
[#578]: https://github.com/stm32-rs/stm32f4xx-hal/pull/578
5160
[#581]: https://github.com/stm32-rs/stm32f4xx-hal/pull/581
52-
[#594]: https://github.com/stm32-rs/stm32f4xx-hal/pull/594
53-
[#595]: https://github.com/stm32-rs/stm32f4xx-hal/pull/595
54-
[#599]: https://github.com/stm32-rs/stm32f4xx-hal/pull/599
55-
[#601]: https://github.com/stm32-rs/stm32f4xx-hal/pull/601
56-
[#603]: https://github.com/stm32-rs/stm32f4xx-hal/pull/603
5761

5862

5963
## [v0.14.0] - 2022-12-12

src/can.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@ impl<CAN: Instance> Can<CAN> {
9595
Can { can, pins }
9696
}
9797

98-
pub fn release<TX, RX, E>(self) -> Result<(CAN, (TX, RX)), E>
99-
where
100-
TX: TryFrom<CAN::Tx, Error = E>,
101-
RX: TryFrom<CAN::Rx, Error = E>,
102-
{
103-
Ok((self.can, (self.pins.0.try_into()?, self.pins.1.try_into()?)))
98+
pub fn release(self) -> (CAN, (CAN::Tx, CAN::Rx)) {
99+
(self.can, self.pins)
104100
}
105101
}
106102

src/fmpi2c.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,8 @@ impl<I2C: Instance> FMPI2c<I2C> {
108108
i2c
109109
}
110110

111-
pub fn release<SCL, SDA, E>(self) -> Result<(I2C, (SCL, SDA)), E>
112-
where
113-
SCL: TryFrom<I2C::Scl, Error = E>,
114-
SDA: TryFrom<I2C::Sda, Error = E>,
115-
{
116-
Ok((self.i2c, (self.pins.0.try_into()?, self.pins.1.try_into()?)))
111+
pub fn release(self) -> (I2C, (I2C::Scl, I2C::Sda)) {
112+
(self.i2c, self.pins)
117113
}
118114
}
119115

src/i2c.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,8 @@ where
182182
i2c
183183
}
184184

185-
pub fn release<SCL, SDA, E>(self) -> Result<(I2C, (SCL, SDA)), E>
186-
where
187-
SCL: TryFrom<I2C::Scl, Error = E>,
188-
SDA: TryFrom<I2C::Sda, Error = E>,
189-
{
190-
Ok((self.i2c, (self.pins.0.try_into()?, self.pins.1.try_into()?)))
185+
pub fn release(self) -> (I2C, (I2C::Scl, I2C::Sda)) {
186+
(self.i2c, self.pins)
191187
}
192188
}
193189

src/i2s.rs

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,9 @@ impl<SPI: Instance> I2s<SPI> {
112112
}
113113
}
114114

115-
pub fn release<WS, CK, MCLK, SD, E>(self) -> Result<(SPI, (WS, CK, MCLK, SD)), E>
116-
where
117-
WS: TryFrom<SPI::Ws, Error = E>,
118-
CK: TryFrom<SPI::Ck, Error = E>,
119-
MCLK: TryFrom<SPI::Mck, Error = E>,
120-
SD: TryFrom<SPI::Sd, Error = E>,
121-
{
122-
Ok((
123-
self.spi,
124-
(
125-
self.pins.0.try_into()?,
126-
self.pins.1.try_into()?,
127-
self.pins.2.try_into()?,
128-
self.pins.3.try_into()?,
129-
),
130-
))
115+
#[allow(clippy::type_complexity)]
116+
pub fn release(self) -> (SPI, (SPI::Ws, SPI::Ck, SPI::Mck, SPI::Sd)) {
117+
(self.spi, self.pins)
131118
}
132119
}
133120

src/qei.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,8 @@ impl<TIM: Instance> Qei<TIM> {
5555
}
5656

5757
/// Releases the TIM peripheral and QEI pins
58-
pub fn release<PC1, PC2, E>(self) -> Result<(TIM, (PC1, PC2)), E>
59-
where
60-
PC1: TryFrom<<TIM as Ch<0>>::Pin, Error = E>,
61-
PC2: TryFrom<<TIM as Ch<1>>::Pin, Error = E>,
62-
{
63-
Ok((self.tim, (self.pins.0.try_into()?, self.pins.1.try_into()?)))
58+
pub fn release(self) -> (TIM, (<TIM as Ch<0>>::Pin, <TIM as Ch<1>>::Pin)) {
59+
(self.tim, self.pins)
6460
}
6561
}
6662

src/serial.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,8 @@ impl<USART: Instance, WORD> Serial<USART, WORD> {
554554
.config_stop(config))
555555
}
556556

557-
pub fn release<TX, RX, E>(self) -> Result<(USART, (TX, RX)), E>
558-
where
559-
TX: TryFrom<USART::TxPin, Error = E>,
560-
RX: TryFrom<USART::RxPin, Error = E>,
561-
{
562-
Ok((
563-
self.tx.usart,
564-
(self.tx.pin.try_into()?, self.rx.pin.try_into()?),
565-
))
557+
pub fn release(self) -> (USART, (USART::TxPin, USART::RxPin)) {
558+
(self.tx.usart, (self.tx.pin, self.rx.pin))
566559
}
567560
}
568561

src/spi.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -489,20 +489,9 @@ impl<SPI: Instance> Spi<SPI, true, u8, Slave> {
489489
}
490490

491491
impl<SPI: Instance, const BIDI: bool, W, OPERATION> Spi<SPI, BIDI, W, OPERATION> {
492-
pub fn release<SCK, MISO, MOSI, E>(self) -> Result<(SPI, (SCK, MISO, MOSI)), E>
493-
where
494-
SCK: TryFrom<SPI::Sck, Error = E>,
495-
MISO: TryFrom<SPI::Miso, Error = E>,
496-
MOSI: TryFrom<SPI::Mosi, Error = E>,
497-
{
498-
Ok((
499-
self.spi,
500-
(
501-
self.pins.0.try_into()?,
502-
self.pins.1.try_into()?,
503-
self.pins.2.try_into()?,
504-
),
505-
))
492+
#[allow(clippy::type_complexity)]
493+
pub fn release(self) -> (SPI, (SPI::Sck, SPI::Miso, SPI::Mosi)) {
494+
(self.spi, self.pins)
506495
}
507496
}
508497

0 commit comments

Comments
 (0)