Skip to content

Commit 38095be

Browse files
mitchmindtreeTheZoq2
authored andcommitted
Add missing SPI3 remap
This is necessary in order for SPI3 to function correctly. Note that this is a breaking change, as it requires access to `MAPR` via a new argument. This has been added as the third argument to match the `spi1` constructor. Tested successfully on an F107.
1 parent f58d8e9 commit 38095be

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- MonoTimer now takes ownership of the DCB register
1313
- SPI objects now have a `FrameSize` type field
1414
- Bit banding functions (`bb::*`) are now correctly marked as unsafe
15+
- Add missing remap to `spi3` constructor. Requires a new `mapr` argument.
1516

1617
### Added
1718

src/spi.rs

+2
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ impl<REMAP, PINS> Spi<SPI3, REMAP, PINS, u8> {
214214
pub fn spi3<F, POS>(
215215
spi: SPI3,
216216
pins: PINS,
217+
mapr: &mut MAPR,
217218
mode: Mode,
218219
freq: F,
219220
clocks: Clocks,
@@ -224,6 +225,7 @@ impl<REMAP, PINS> Spi<SPI3, REMAP, PINS, u8> {
224225
REMAP: Remap<Periph = SPI3>,
225226
PINS: Pins<REMAP, POS>,
226227
{
228+
mapr.modify_mapr(|_, w| w.spi3_remap().bit(REMAP::REMAP));
227229
Spi::<SPI3, _, _, u8>::_spi(spi, pins, mode, freq.into(), clocks, apb)
228230
}
229231
}

0 commit comments

Comments
 (0)