Skip to content

Commit

Permalink
Bump stm32f4xx-hal in /examples/stm32f4-event-printer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
dependabot[bot] and rursprung committed Nov 21, 2023
1 parent ced28ec commit ec8b811
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 30 deletions.
53 changes: 34 additions & 19 deletions examples/stm32f4-event-printer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/stm32f4-event-printer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cortex-m = { version = "0.7", features = ["critical-section-single-core"]}
cortex-m-rtic = "1.1.4"
panic-probe = { version = "0.3", features = ["print-defmt"] }

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

fugit = "0.3"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ impl BluefruitLEUARTFriend {
}

pub fn handle_bluetooth_message(&mut self) {
if !self.rx_transfer.is_transfer_complete() {
return;
}

let (filled_buffer, _) = self
.rx_transfer
.next_transfer(self.rx_buffer.take().unwrap())
Expand Down
14 changes: 4 additions & 10 deletions examples/stm32f4-event-printer/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ mod adafruit_bluefruit_le_uart_friend;
#[rtic::app(device = stm32f4xx_hal::pac, dispatchers = [EXTI1])]
mod app {
use crate::adafruit_bluefruit_le_uart_friend::BluefruitLEUARTFriend;
use stm32f4xx_hal::dma::Stream2;
use stm32f4xx_hal::{
dma::traits::StreamISR, pac, pac::DMA2, prelude::*, timer::MonoTimerUs,
watchdog::IndependentWatchdog,
};
use stm32f4xx_hal::{pac, prelude::*, timer::MonoTimerUs, watchdog::IndependentWatchdog};

#[monotonic(binds = TIM2, default = true)]
type MicrosecMono = MonoTimerUs<pac::TIM2>;
Expand Down Expand Up @@ -77,11 +73,9 @@ mod app {
#[task(binds = DMA2_STREAM2, shared = [bt_module])]
fn bluetooth_dma_interrupt(mut ctx: bluetooth_dma_interrupt::Context) {
defmt::debug!("received DMA2_STREAM2 interrupt (transfer complete)");
if Stream2::<DMA2>::get_transfer_complete_flag() {
ctx.shared.bt_module.lock(|bt_module| {
bt_module.handle_bluetooth_message();
});
}
ctx.shared.bt_module.lock(|bt_module| {
bt_module.handle_bluetooth_message();
});
}

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

0 comments on commit ec8b811

Please sign in to comment.