summaryrefslogtreecommitdiffstats
path: root/ble/src/main.rs
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2019-08-19 21:06:42 -0400
committerBrian Cully <bjc@kublai.com>2019-08-19 21:06:42 -0400
commit784db2bc6ca1dac88a60fcf5919ae5f7fa98f688 (patch)
treeaa8a5e5ca7ae0af26d03f4bc98c2fa4905d56a80 /ble/src/main.rs
parenta3b976df4b1214c6f4e2a053724398b1a5e1767b (diff)
downloadbleusb-784db2bc6ca1dac88a60fcf5919ae5f7fa98f688.tar.gz
bleusb-784db2bc6ca1dac88a60fcf5919ae5f7fa98f688.zip
Clumsy, but BLE advertising is up.
Diffstat (limited to 'ble/src/main.rs')
-rw-r--r--ble/src/main.rs9
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();
}
});