From 8e8106ef555373f8b0f04fe1f67684efef435a94 Mon Sep 17 00:00:00 2001 From: Timo Kröger Date: Sat, 25 Jun 2022 07:01:31 +0200 Subject: lora: Improve IRQ handling * Interrupt handler only triggers a waker: Do the actual interrupt processing which involves SUBGHZ SPI coms in the task. * Do not require a static state for the constructor. * Remove unsafe from construcor. --- examples/stm32wl/src/bin/lorawan.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/stm32wl/src/bin/lorawan.rs b/examples/stm32wl/src/bin/lorawan.rs index fdd7eb8cf..9c390bdf0 100644 --- a/examples/stm32wl/src/bin/lorawan.rs +++ b/examples/stm32wl/src/bin/lorawan.rs @@ -32,10 +32,9 @@ async fn main(_spawner: Spawner) { let rfs = RadioSwitch::new(ctrl1, ctrl2, ctrl3); let radio = SubGhz::new(p.SUBGHZSPI, NoDma, NoDma); - let irq = interrupt::take!(SUBGHZ_RADIO); - static mut RADIO_STATE: SubGhzState<'static> = SubGhzState::new(); - let radio = unsafe { SubGhzRadio::new(&mut RADIO_STATE, radio, rfs, irq) }; + + let radio = SubGhzRadio::new(radio, rfs, irq); let mut region: region::Configuration = region::EU868::default().into(); -- cgit