Skip to content

Commit 0161136

Browse files
authored
Merge pull request #295 from Sh3Rm4n/fix/v0.8.1
Fix/v0.8.1
2 parents 0f5b680 + be46dd1 commit 0161136

File tree

6 files changed

+13
-8
lines changed

6 files changed

+13
-8
lines changed

CHANGELOG.md

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

1515
## Unreleased
1616

17-
No changes.
17+
### Fixed
18+
19+
- ADC Channel SMP Register mismatch. ([#291])
20+
- While `read()`ing a Pin mapped to channel `10` and unexpected panic happened.
1821

1922
## [v0.8.0] - 2021-08-16
2023

@@ -476,6 +479,7 @@ let clocks = rcc
476479
[defmt]: https://github.com/knurling-rs/defmt
477480
[filter]: https://defmt.ferrous-systems.com/filtering.html
478481

482+
[#291]: https://github.com/stm32-rs/stm32f3xx-hal/pull/291
479483
[#278]: https://github.com/stm32-rs/stm32f3xx-hal/pull/278
480484
[#277]: https://github.com/stm32-rs/stm32f3xx-hal/pull/277
481485
[#273]: https://github.com/stm32-rs/stm32f3xx-hal/pull/273

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ panic-probe = "0.2.0"
5959
panic-semihosting = "0.5.6"
6060
usbd-serial = "0.1.1"
6161
usb-device = "0.2.8"
62-
cortex-m-rtic = "=0.6.0-alpha.5"
63-
dwt-systick-monotonic = "=0.1.0-alpha.3"
62+
cortex-m-rtic = "=0.6.0-rc.2"
63+
dwt-systick-monotonic = "=0.1.0-rc.1"
6464
panic-rtt-target = { version = "0.1", features = ["cortex-m"] }
6565
rtt-target = { version = "0.3.0", features = ["cortex-m"] }
6666

src/adc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,8 @@ macro_rules! adc_hal {
498498
7 => self.adc.smpr1.modify(|_, w| w.smp7().variant(smp.into())),
499499
8 => self.adc.smpr1.modify(|_, w| w.smp8().variant(smp.into())),
500500
9 => self.adc.smpr1.modify(|_, w| w.smp9().variant(smp.into())),
501-
11 => self.adc.smpr2.modify(|_, w| w.smp10().variant(smp.into())),
501+
10 => self.adc.smpr2.modify(|_, w| w.smp10().variant(smp.into())),
502+
11 => self.adc.smpr2.modify(|_, w| w.smp11().variant(smp.into())),
502503
12 => self.adc.smpr2.modify(|_, w| w.smp12().variant(smp.into())),
503504
13 => self.adc.smpr2.modify(|_, w| w.smp13().variant(smp.into())),
504505
14 => self.adc.smpr2.modify(|_, w| w.smp14().variant(smp.into())),

src/dma.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ macro_rules! dma {
514514

515515
// NOTE(unsafe) atomic write to a stateless register
516516
unsafe {
517-
&(*$DMAx::ptr()).ifcr.write(|w| match event {
517+
(*$DMAx::ptr()).ifcr.write(|w| match event {
518518
HalfTransfer => w.$chtifi().set_bit(),
519519
TransferComplete => w.$ctcifi().set_bit(),
520520
TransferError => w.$cteifi().set_bit(),

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ mod private {
132132
let mask = !(u32::MAX >> (32 - $bitwidth) << ($bitwidth * $index));
133133
let value = $value << ($bitwidth * $index);
134134
w.bits(r.bits() & mask | value)
135-
});
135+
})
136136
};
137137
}
138138
pub(crate) use modify_at;

testsuite/tests/adc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ mod tests {
7272
defmt::debug!("{}", adc_level);
7373
defmt::unwrap!(state.output.set_low());
7474
// Vref is 3V so output should reach the maximum.
75-
assert!(adc_level >= 3900 && adc_level <= 4100);
75+
assert!(adc_level >= 3500 && adc_level <= 4100);
7676
let adc_level: u16 = defmt::unwrap!(adc.read(&mut state.analog).ok());
7777
defmt::debug!("{}", adc_level);
7878
// nearly zero (always zero can not be guaranteed)
79-
assert!(adc_level <= 100);
79+
assert!(adc_level <= 300);
8080
}
8181

8282
// put adc back in place

0 commit comments

Comments
 (0)