Tobi's ubw test branch

Dependencies:   mavlink_bridge mbed

Fork of AIT_UWB_Range by Benjamin Hepp

Revision:
60:43be9228b3b9
Parent:
53:79a72d752ec4
Child:
65:4c3bd79b57d2
--- a/DW1000/DW1000.cpp	Mon Jan 04 20:55:33 2016 +0000
+++ b/DW1000/DW1000.cpp	Tue Jan 05 08:59:30 2016 +0000
@@ -266,6 +266,16 @@
     writeRegister16(DW1000_SYS_MASK, 0, RX*0x4000 | TX*0x0080);  // RX good frame 0x4000, TX done 0x0080
 }
 
+void DW1000::resetInterruptFlags() {
+    uint64_t status = getStatus();
+    if (status & 0x4000) {                                          // a frame was received
+        writeRegister16(DW1000_SYS_STATUS, 0, 0x6F00);              // clearing of receiving status bits
+    }
+    if (status & 0x80) {                                            // sending complete
+        writeRegister8(DW1000_SYS_STATUS, 0, 0xF8);                 // clearing of sending status bits
+    }
+}
+
 void DW1000::ISR() {
     uint64_t status = getStatus();
     if (status & 0x4000) {                                          // a frame was received