Eurobot2012_Primary
Dependencies: mbed Eurobot_2012_Primary
Diff: Kalman/IR/IR.cpp
- Revision:
- 7:f9c59a3e4155
- Parent:
- 5:7ac07bf30707
--- a/Kalman/IR/IR.cpp Fri Apr 27 14:29:56 2012 +0000 +++ b/Kalman/IR/IR.cpp Fri Apr 27 16:37:26 2012 +0000 @@ -32,24 +32,17 @@ void IR::vIRValueISR (void) { - - - // A workaround for mbed UART ISR bug // Clear the RBR flag to make sure the interrupt doesn't loop // UART3 for the port on pins 9/10, UART2 for pins 28/27, and UART1 for pins 13/14. // UART0 for USB UART + #ifdef ROBOT_PRIMARY unsigned char RBR = LPC_UART3->RBR; #else unsigned char RBR = LPC_UART1->RBR; #endif - //printf("%#x/n", RBR); - - OLED3 = !OLED3; - return; - // bytes packing/unpacking for IR turret serial comm static union IRValue_t { float IR_floats[3]; @@ -76,10 +69,7 @@ if (buff_pointer >= 12) { buff_pointer = 0; data_flag = false; // dessert the dataflag - - - - /* + if (angleInit) { kalman.runupdate(Kalman::measurement_t(IRValues.IR_ints[0]+3),rectifyAng(IRValues.IR_floats[1] - angleOffset),IRValues.IR_floats[2]); } else { @@ -89,8 +79,6 @@ //only update the IRMeasures used by kalman init kalman.IRMeasures[IRValues.IR_ints[0]] = IRValues.IR_floats[1]; } - */ - }