diff options
Diffstat (limited to 'ble/src/main.rs')
-rw-r--r-- | ble/src/main.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ble/src/main.rs b/ble/src/main.rs index 36c3228..137c8a7 100644 --- a/ble/src/main.rs +++ b/ble/src/main.rs @@ -83,7 +83,7 @@ fn main() -> ! { let uarte1 = uarte1(nrf52.UARTE1, txp, rxp); let (mut uarte1_reader, mut uarte1_handler) = uarte1::setup(uarte1); - //ble::setup(nrf52.RADIO, nrf52.TIMER0, nrf52.FICR); + let mut resp = ble::setup(nrf52.RADIO, nrf52.TIMER0, nrf52.FICR); HANDLERS.with_overrides(|hs| { hs.register(0, &mut rtc_handler); @@ -93,6 +93,9 @@ fn main() -> ! { hs.register(2, &mut uarte1_handler); nvic.enable(Interrupt::UARTE1); + nvic.enable(Interrupt::TIMER0); + nvic.enable(Interrupt::RADIO); + info!("Bootstrap complete."); // Buffer is just scratch space that always gets written to @@ -122,6 +125,10 @@ fn main() -> ! { ); len = uarte1_reader.shift_into(&mut buf); } + + if resp.has_work() { + resp.process_one().expect("ble response processing"); + } wfi(); } }); |