Tobi's ubw test branch

Dependencies:   mavlink_bridge mbed

Fork of AIT_UWB_Range by Benjamin Hepp

Revision:
54:a59803fcce58
Parent:
53:79a72d752ec4
Child:
55:0587f7ad4bdd
diff -r 79a72d752ec4 -r a59803fcce58 main.cpp
--- a/main.cpp	Mon Jan 04 12:45:37 2016 +0000
+++ b/main.cpp	Mon Jan 04 16:02:47 2016 +0000
@@ -3,7 +3,9 @@
 #include "PC.h"                                     // Serial Port via USB for debugging with Terminal
 #include "DW1000.h"                                 // our DW1000 device driver
 #include "MM2WayRanging.h"                          // our self developed ranging application
-#include "InterruptMultiplexer.h"
+// HACK
+//#include "InterruptMultiplexer.h"
+#include "InterruptHandler.h"
 
 #include "mavlink_bridge/mavlink_bridge.h"
 
@@ -84,8 +86,9 @@
     spi.frequency(SPI_FREQUENCY);             // with a 1MHz clock rate (worked up to 49MHz in our Test)
 
     // Setup interrupt pin
-    InterruptMultiplexer irq_mp(DW_IRQ_PIN);
-    irq_mp.getIRQ().rise(&irq_mp, &InterruptMultiplexer::trigger);  // attach interrupt handler to rising edge of interrupt pin from DW1000
+    // HACK
+    //InterruptMultiplexer irq_mp(DW_IRQ_PIN);
+    //irq_mp.getIRQ().rise(&irq_mp, &InterruptMultiplexer::trigger);  // attach interrupt handler to rising edge of interrupt pin from DW1000
 
     Timer timer;
     timer.start();
@@ -102,6 +105,10 @@
     DW1000::hardwareReset(DW_RESET_PIN);
     for (int i = 0; i < 2; ++i) {
 
+        // HACK
+        InterruptHandler irq_mp(DW_IRQ_PIN);
+        irq_mp.getIRQ().rise(&irq_mp, &InterruptHandler::trigger);  // attach interrupt handler to rising edge of interrupt pin from DW1000
+
         dw_array[i] = new DW1000(spi, irq_mp, DW_CS_PINS[i]);   // Device driver instanceSPI pins: (MOSI, MISO, SCLK, CS, IRQ, RESET)
 
         // dw_array[1] = new DW1000(spi, irq_mp, DW_CS_PINS[1]);   // Device driver instanceSPI pins: (MOSI, MISO, SCLK, CS, IRQ, RESET)
@@ -163,4 +170,7 @@
 //        }
 //    }
 
+    while (true)
+    {
+    }
 }