From 784db2bc6ca1dac88a60fcf5919ae5f7fa98f688 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 19 Aug 2019 21:06:42 -0400 Subject: Clumsy, but BLE advertising is up. --- ble/src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ble/src/main.rs') 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(); } }); -- cgit v1.2.3