Skip to content

Commit ec8b811

Browse files
Bump stm32f4xx-hal in /examples/stm32f4-event-printer
Due to the refactorings of the stream APIs the code had to be adapted (the transfer flag is now part of the transfer). Bumps [stm32f4xx-hal](https://github.com/stm32-rs/stm32f4xx-hal) from 0.17.1 to 0.18.0. - [Release notes](https://github.com/stm32-rs/stm32f4xx-hal/releases) - [Changelog](https://github.com/stm32-rs/stm32f4xx-hal/blob/master/CHANGELOG.md) - [Commits](stm32-rs/stm32f4xx-hal@v0.17.1...v0.18.0) --- updated-dependencies: - dependency-name: stm32f4xx-hal dependency-type: direct:production update-type: version-update:semver-minor ... Co-Authored-By: Ralph Ursprung <[email protected]> Signed-off-by: dependabot[bot] <[email protected]>
1 parent ced28ec commit ec8b811

File tree

4 files changed

+43
-30
lines changed

4 files changed

+43
-30
lines changed

examples/stm32f4-event-printer/Cargo.lock

Lines changed: 34 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/stm32f4-event-printer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
99
cortex-m-rtic = "1.1.4"
1010
panic-probe = { version = "0.3", features = ["print-defmt"] }
1111

12-
stm32f4xx-hal = { version = "0.17", features = ["stm32f401", "rtic", "rtic-monotonic"] }
12+
stm32f4xx-hal = { version = "0.18", features = ["stm32f401", "rtic", "rtic-monotonic"] }
1313

1414
fugit = "0.3"
1515

examples/stm32f4-event-printer/src/adafruit_bluefruit_le_uart_friend.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ impl BluefruitLEUARTFriend {
7171
}
7272

7373
pub fn handle_bluetooth_message(&mut self) {
74+
if !self.rx_transfer.is_transfer_complete() {
75+
return;
76+
}
77+
7478
let (filled_buffer, _) = self
7579
.rx_transfer
7680
.next_transfer(self.rx_buffer.take().unwrap())

examples/stm32f4-event-printer/src/main.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ mod adafruit_bluefruit_le_uart_friend;
1515
#[rtic::app(device = stm32f4xx_hal::pac, dispatchers = [EXTI1])]
1616
mod app {
1717
use crate::adafruit_bluefruit_le_uart_friend::BluefruitLEUARTFriend;
18-
use stm32f4xx_hal::dma::Stream2;
19-
use stm32f4xx_hal::{
20-
dma::traits::StreamISR, pac, pac::DMA2, prelude::*, timer::MonoTimerUs,
21-
watchdog::IndependentWatchdog,
22-
};
18+
use stm32f4xx_hal::{pac, prelude::*, timer::MonoTimerUs, watchdog::IndependentWatchdog};
2319

2420
#[monotonic(binds = TIM2, default = true)]
2521
type MicrosecMono = MonoTimerUs<pac::TIM2>;
@@ -77,11 +73,9 @@ mod app {
7773
#[task(binds = DMA2_STREAM2, shared = [bt_module])]
7874
fn bluetooth_dma_interrupt(mut ctx: bluetooth_dma_interrupt::Context) {
7975
defmt::debug!("received DMA2_STREAM2 interrupt (transfer complete)");
80-
if Stream2::<DMA2>::get_transfer_complete_flag() {
81-
ctx.shared.bt_module.lock(|bt_module| {
82-
bt_module.handle_bluetooth_message();
83-
});
84-
}
76+
ctx.shared.bt_module.lock(|bt_module| {
77+
bt_module.handle_bluetooth_message();
78+
});
8579
}
8680

8781
#[task(binds = USART1, shared = [bt_module])]

0 commit comments

Comments
 (0)