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.
This commit is contained in:
Timo Kröger
2022-06-25 07:01:31 +02:00
parent 61c666212f
commit 8e8106ef55
2 changed files with 54 additions and 77 deletions

View File

@ -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();