Skip to content

Commit

Permalink
Add missing SPI3 remap
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mitchmindtree committed Sep 23, 2020
1 parent b19fbb0 commit 2b59b78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

- MonoTimer now takes ownership of the DCB register
- SPI objects now have a `FrameSize` type field
- Add missing remap to `spi3` constructor. Requires a new `mapr` argument.

### Added

Expand Down
2 changes: 2 additions & 0 deletions src/spi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ impl<REMAP, PINS> Spi<SPI3, REMAP, PINS, u8> {
pub fn spi3<F, POS>(
spi: SPI3,
pins: PINS,
mapr: &mut MAPR,
mode: Mode,
freq: F,
clocks: Clocks,
Expand All @@ -224,6 +225,7 @@ impl<REMAP, PINS> Spi<SPI3, REMAP, PINS, u8> {
REMAP: Remap<Periph = SPI3>,
PINS: Pins<REMAP, POS>,
{
mapr.modify_mapr(|_, w| w.spi3_remap().bit(REMAP::REMAP));
Spi::<SPI3, _, _, u8>::_spi(spi, pins, mode, freq.into(), clocks, apb)
}
}
Expand Down

0 comments on commit 2b59b78

Please sign in to comment.