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:
@ -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();
|
||||
|
||||
|
Reference in New Issue
Block a user