Tobi's ubw test branch
Dependencies: mavlink_bridge mbed
Fork of AIT_UWB_Range by
Diff: DW1000/DW1000.cpp
- Revision:
- 65:4c3bd79b57d2
- Parent:
- 60:43be9228b3b9
- Child:
- 67:bd0f0580af5a
--- a/DW1000/DW1000.cpp Tue Jan 05 09:39:50 2016 +0000 +++ b/DW1000/DW1000.cpp Tue Jan 05 09:54:33 2016 +0000 @@ -6,10 +6,7 @@ //#include "PC.h" //static PC pc(USBTX, USBRX, 115200); // USB UART Terminal -DW1000::DW1000(SPI& spi, InterruptMultiplexer& irq_mp, PinName CS, PinName RESET) : spi(spi), cs(CS), irq_mp(irq_mp), reset(RESET) { - irq_index = irq_mp.addCallback(this, &DW1000::ISR, false); - - +DW1000::DW1000(SPI& spi, InterruptIn& irq, PinName CS, PinName RESET) : spi(spi), cs(CS), irq(irq), reset(RESET) { setCallbacks(NULL, NULL); deselect(); //wait(2); @@ -368,22 +365,22 @@ } void DW1000::select() { // always called to start an SPI transmission - irq_mp.getIRQ().disable_irq(); + irq.disable_irq(); cs = 0; // set Cable Select pin low to start transmission } void DW1000::deselect() { // always called to end an SPI transmission cs = 1; // set Cable Select pin high to stop transmission - irq_mp.getIRQ().enable_irq(); + irq.enable_irq(); } void DW1000::enable_irq() { // always called to start an SPI transmission //printf("Enabling irq %d\r\n", irq_index); - irq_mp.enableCallback(irq_index); + //irq_mp.enableCallback(irq_index); //irq_mp.enable_irq(); } void DW1000::disable_irq() { // always called to end an SPI transmission - irq_mp.disableCallback(irq_index); + //irq_mp.disableCallback(irq_index); //irq_mp.disable_irq(); }