|
From: <rum...@us...> - 2008-06-26 10:21:38
|
Revision: 229
http://gearbox.svn.sourceforge.net/gearbox/?rev=229&view=rev
Author: rumataxyz
Date: 2008-06-26 03:21:46 -0700 (Thu, 26 Jun 2008)
Log Message:
-----------
fixed logic bugs (assumed wrong precedence)
Modified Paths:
--------------
gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp
gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h
Modified: gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp
===================================================================
--- gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp 2008-06-26 10:20:23 UTC (rev 228)
+++ gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/imudecoder.cpp 2008-06-26 10:21:46 UTC (rev 229)
@@ -18,7 +18,7 @@
public:
virtual ~ImuDecoderHg1700(){}
inline bool statusIsGood(const uint32_t imuStatus){
- return 0 == (imuStatus & 0xf8000010);
+ return 0 == ((imuStatus & 0xf8000010));
}
std::string statusToString(const uint32_t imuStatus);
};
@@ -42,25 +42,25 @@
ImuDecoderHg1700::statusToString(const uint32_t imuStatus){
std::stringstream ss;
ss << "IMU test: "
- << (( 0 == imuStatus & 0x00000010) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000010)) ? "pass;" : "fail;") << " ";
ss << "Z-gyro path-length control: "
- << (( 0 == imuStatus & 0x00000020) ? "good;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000020)) ? "good;" : "fail;") << " ";
ss << "Y-gyro path-length control: "
- << (( 0 == imuStatus & 0x00000040) ? "good;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000040)) ? "good;" : "fail;") << " ";
ss << "X-gyro path-length control: "
- << (( 0 == imuStatus & 0x00000080) ? "good;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000080)) ? "good;" : "fail;") << " ";
ss << "Gyro tests: "
- << (( 0 == imuStatus & 0x08000000) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x08000000)) ? "pass;" : "fail;") << " ";
ss << "Accelerometer tests: "
- << (( 0 == imuStatus & 0x10000000) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x10000000)) ? "pass;" : "fail;") << " ";
ss << "Other test: "
- << (( 0 == imuStatus & 0x20000000) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x20000000)) ? "pass;" : "fail;") << " ";
ss << "Memory test: "
- << (( 0 == imuStatus & 0x40000000) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x40000000)) ? "pass;" : "fail;") << " ";
ss << "Processor test: "
- << (( 0 == imuStatus & 0x80000000) ? "pass;" : "fail;") << " ";
- int temprAccel = (imuStatus & 0x0000ff00) >> 8;
- int softwVersion = (imuStatus & 0x00ff0000) >> 16;
+ << (( 0 == (imuStatus & 0x80000000)) ? "pass;" : "fail;") << " ";
+ int temprAccel = ((imuStatus & 0x0000ff00)) >> 8;
+ int softwVersion = ((imuStatus & 0x00ff0000)) >> 16;
ss << "Accelerometer temprature [C]: " << temprAccel << " ";
ss << "Software version number: " << softwVersion;
@@ -75,7 +75,7 @@
std::cout << "This driver has _not_ been tested with this IMU!\n";
};
inline bool statusIsGood(const uint32_t imuStatus){
- return 0 == (imuStatus & 0xefec9580);
+ return 0 == ((imuStatus & 0xefec9580));
}
std::string statusToString(const uint32_t imuStatus);
};
@@ -84,45 +84,45 @@
ImuDecoderImarFsas::statusToString(const uint32_t imuStatus){
std::stringstream ss;
ss << "Gyro warm-up: "
- << (( 0 == imuStatus & 0x00000010 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000010 )) ? "pass;" : "fail;") << " ";
ss << "Gyro self-test active: "
- << (( 0 == imuStatus & 0x00000020 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000020 )) ? "pass;" : "fail;") << " ";
ss << "Gyro status bit set: "
- << (( 0 == imuStatus & 0x00000040 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000040 )) ? "pass;" : "fail;") << " ";
ss << "Gyro time-out command interface: "
- << (( 0 == imuStatus & 0x00000080 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000080 )) ? "pass;" : "fail;") << " ";
ss << "Power-up built-in test (PBIT): "
- << (( 0 == imuStatus & 0x00000100 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000100 )) ? "pass;" : "fail;") << " ";
ss << "Interrupt: "
- << (( 0 == imuStatus & 0x00000400 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000400 )) ? "pass;" : "fail;") << " ";
ss << "Warm-up: "
- << (( 0 == imuStatus & 0x00001000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00001000 )) ? "pass;" : "fail;") << " ";
ss << "Initiated built-in test (IBIT): "
- << (( 0 == imuStatus & 0x00008000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00008000 )) ? "pass;" : "fail;") << " ";
ss << "Accelerometer: "
- << (( 0 == imuStatus & 0x00040000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00040000 )) ? "pass;" : "fail;") << " ";
ss << "Accelerometer time-out: "
- << (( 0 == imuStatus & 0x00080000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00080000 )) ? "pass;" : "fail;") << " ";
ss << "Gyro initiated BIT: "
- << (( 0 == imuStatus & 0x00200000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00200000 )) ? "pass;" : "fail;") << " ";
ss << "Gyro self-test: "
- << (( 0 == imuStatus & 0x00400000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00400000 )) ? "pass;" : "fail;") << " ";
ss << "Gyro time-out: "
- << (( 0 == imuStatus & 0x00800000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00800000 )) ? "pass;" : "fail;") << " ";
ss << "Analog-to-Digital (AD): "
- << (( 0 == imuStatus & 0x01000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x01000000 )) ? "pass;" : "fail;") << " ";
ss << "Testmode: "
- << (( 0 == imuStatus & 0x02000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x02000000 )) ? "pass;" : "fail;") << " ";
ss << "Software: "
- << (( 0 == imuStatus & 0x04000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x04000000 )) ? "pass;" : "fail;") << " ";
ss << "RAM/ROM: "
- << (( 0 == imuStatus & 0x08000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x08000000 )) ? "pass;" : "fail;") << " ";
ss << "Operational: "
- << (( 0 == imuStatus & 0x20000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x20000000 )) ? "pass;" : "fail;") << " ";
ss << "Interface: "
- << (( 0 == imuStatus & 0x40000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x40000000 )) ? "pass;" : "fail;") << " ";
ss << "Interface time-out: "
- << (( 0 == imuStatus & 0x80000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x80000000 )) ? "pass;" : "fail;") << " ";
return ss.str();
}
@@ -136,7 +136,7 @@
std::cout << "This driver has _not_ been tested with this IMU!\n";
};
inline bool statusIsGood(const uint32_t imuStatus){
- return 0 == (imuStatus & 0xf8000010);
+ return 0 == ((imuStatus & 0xf8000010));
}
std::string statusToString(const uint32_t imuStatus);
};
@@ -146,47 +146,47 @@
std::stringstream ss;
ss << "Delta_velocity_counter: "
- << (( 0 == imuStatus & 0x00000001 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000001 )) ? "pass;" : "fail;") << " ";
ss << "D/A_converter: "
- << (( 0 == imuStatus & 0x00000002 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000002 )) ? "pass;" : "fail;") << " ";
ss << "Gyro: "
- << (( 0 == imuStatus & 0x00000004 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000004 )) ? "pass;" : "fail;") << " ";
ss << "Accelerometer: "
- << (( 0 == imuStatus & 0x00000008 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000008 )) ? "pass;" : "fail;") << " ";
ss << "Gyro_loop_control: "
- << (( 0 == imuStatus & 0x00000010 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000010 )) ? "pass;" : "fail;") << " ";
ss << "Gyro_temperature_control: "
- << (( 0 == imuStatus & 0x00000020 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000020 )) ? "pass;" : "fail;") << " ";
ss << "Accelerometer_temperature: "
- << (( 0 == imuStatus & 0x00000040 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000040 )) ? "pass;" : "fail;") << " ";
ss << "Accelerometer_temperature: "
- << (( 0 == imuStatus & 0x00000040 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000040 )) ? "pass;" : "fail;") << " ";
ss << "A/D_converter: "
- << (( 0 == imuStatus & 0x00000100 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000100 )) ? "pass;" : "fail;") << " ";
ss << "Serial_I/O: "
- << (( 0 == imuStatus & 0x00000200 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000200 )) ? "pass;" : "fail;") << " ";
ss << "Serial_I/O: "
- << (( 0 == imuStatus & 0x00000200 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000200 )) ? "pass;" : "fail;") << " ";
ss << "Laser_diode: "
- << (( 0 == imuStatus & 0x00000800 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00000800 )) ? "pass;" : "fail;") << " ";
ss << "Thermo-electric_cooler_(TEC): "
- << (( 0 == imuStatus & 0x00001000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00001000 )) ? "pass;" : "fail;") << " ";
ss << "Broadband_Fiber_Source_(BFS)_fiber_temperature: "
- << (( 0 == imuStatus & 0x00002000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00002000 )) ? "pass;" : "fail;") << " ";
ss << "Optical_receiver: "
- << (( 0 == imuStatus & 0x00004000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x00004000 )) ? "pass;" : "fail;") << " ";
ss << "Gyro_accuracy: "
- << (( 0 == imuStatus & 0x01000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x01000000 )) ? "pass;" : "fail;") << " ";
ss << "Gyro: "
- << (( 0 == imuStatus & 0x02000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x02000000 )) ? "pass;" : "fail;") << " ";
ss << "Shut_down_on_failure: "
- << (( 0 == imuStatus & 0x04000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x04000000 )) ? "pass;" : "fail;") << " ";
ss << "Fast_start: "
- << (( 0 == imuStatus & 0x08000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x08000000 )) ? "pass;" : "fail;") << " ";
ss << "Commanded_bit_in_progress: "
- << (( 0 == imuStatus & 0x10000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x10000000 )) ? "pass;" : "fail;") << " ";
ss << "Accelerometer_data: "
- << (( 0 == imuStatus & 0x40000000 ) ? "pass;" : "fail;") << " ";
+ << (( 0 == (imuStatus & 0x40000000 )) ? "pass;" : "fail;") << " ";
return ss.str();
}
Modified: gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h
===================================================================
--- gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h 2008-06-26 10:20:23 UTC (rev 228)
+++ gearbox/trunk/submitted/gbxnovatelacfr/gbxnovatelutilacfr/receiverstatusdecoder.h 2008-06-26 10:21:46 UTC (rev 229)
@@ -24,51 +24,51 @@
std::string receiverStatusToString(uint32_t receiverStatus){
std::stringstream ss;
ss << "Error flag: "
- << ((0 == receiverStatus & 0x00000001) ? "No error" : "Error") << "; ";
+ << ((0 == (receiverStatus & 0x00000001)) ? "No error" : "Error") << "; ";
ss << "Temperature status: "
- << ((0 == receiverStatus & 0x00000002) ? "Within specifications" : "Warning") << "; ";
+ << ((0 == (receiverStatus & 0x00000002)) ? "Within specifications" : "Warning") << "; ";
ss << "Voltage supply status: "
- << ((0 == receiverStatus & 0x00000004) ? "OK" : "Warning") << "; ";
+ << ((0 == (receiverStatus & 0x00000004)) ? "OK" : "Warning") << "; ";
ss << "Antenna power status: "
- << ((0 == receiverStatus & 0x00000008) ? "Powered" : "Not powered") << "; ";
+ << ((0 == (receiverStatus & 0x00000008)) ? "Powered" : "Not powered") << "; ";
ss << "Antenna open flag: "
- << ((0 == receiverStatus & 0x00000020) ? "OK" : "Open") << "; ";
+ << ((0 == (receiverStatus & 0x00000020)) ? "OK" : "Open") << "; ";
ss << "Antenna shorted flag: "
- << ((0 == receiverStatus & 0x00000040) ? "OK" : "Shorted") << "; ";
+ << ((0 == (receiverStatus & 0x00000040)) ? "OK" : "Shorted") << "; ";
ss << "CPU overload flag: "
- << ((0 == receiverStatus & 0x00000080) ? "No overload" : "Overload") << "; ";
+ << ((0 == (receiverStatus & 0x00000080)) ? "No overload" : "Overload") << "; ";
ss << "COM1 buffer overrun flag: "
- << ((0 == receiverStatus & 0x00000100) ? "No overrun" : "Overrun") << "; ";
+ << ((0 == (receiverStatus & 0x00000100)) ? "No overrun" : "Overrun") << "; ";
ss << "COM2 buffer overrun flag: "
- << ((0 == receiverStatus & 0x00000200) ? "No overrun" : "Overrun") << "; ";
+ << ((0 == (receiverStatus & 0x00000200)) ? "No overrun" : "Overrun") << "; ";
ss << "COM3 buffer overrun flag: "
- << ((0 == receiverStatus & 0x00000400) ? "No overrun" : "Overrun") << "; ";
+ << ((0 == (receiverStatus & 0x00000400)) ? "No overrun" : "Overrun") << "; ";
ss << "USB buffer overrun flag: "
- << ((0 == receiverStatus & 0x00000800) ? "No overrun" : "Overrun") << "; ";
+ << ((0 == (receiverStatus & 0x00000800)) ? "No overrun" : "Overrun") << "; ";
ss << "RF1 AGC status: "
- << ((0 == receiverStatus & 0x00008000) ? "OK" : "Bad") << "; ";
+ << ((0 == (receiverStatus & 0x00008000)) ? "OK" : "Bad") << "; ";
ss << "RF2 AGC status: "
- << ((0 == receiverStatus & 0x00020000) ? "OK" : "Bad") << "; ";
+ << ((0 == (receiverStatus & 0x00020000)) ? "OK" : "Bad") << "; ";
ss << "Almanac flag/UTC known: "
- << ((0 == receiverStatus & 0x00040000) ? "Valid" : "Invalid") << "; ";
+ << ((0 == (receiverStatus & 0x00040000)) ? "Valid" : "Invalid") << "; ";
ss << "Position solution flag: "
- << ((0 == receiverStatus & 0x00080000) ? "Valid" : "Invalid") << "; ";
+ << ((0 == (receiverStatus & 0x00080000)) ? "Valid" : "Invalid") << "; ";
ss << "Position fixed flag: "
- << ((0 == receiverStatus & 0x00100000) ? "Not" : "fixed Fixed") << "; ";
+ << ((0 == (receiverStatus & 0x00100000)) ? "Not" : "fixed Fixed") << "; ";
ss << "Clock steering status: "
- << ((0 == receiverStatus & 0x00200000) ? "Enabled" : "Disabled") << "; ";
+ << ((0 == (receiverStatus & 0x00200000)) ? "Enabled" : "Disabled") << "; ";
ss << "Clock model flag: "
- << ((0 == receiverStatus & 0x00400000) ? "Valid" : "Invalid") << "; ";
+ << ((0 == (receiverStatus & 0x00400000)) ? "Valid" : "Invalid") << "; ";
ss << "OEMV card external oscillator flag: "
- << ((0 == receiverStatus & 0x00800000) ? "Disabled" : "Enabled") << "; ";
+ << ((0 == (receiverStatus & 0x00800000)) ? "Disabled" : "Enabled") << "; ";
ss << "Software resource: "
- << ((0 == receiverStatus & 0x01000000) ? "OK" : "Warning") << "; ";
+ << ((0 == (receiverStatus & 0x01000000)) ? "OK" : "Warning") << "; ";
ss << "Auxiliary 3 status event flag: "
- << ((0 == receiverStatus & 0x20000000) ? "No event" : "Event") << "; ";
+ << ((0 == (receiverStatus & 0x20000000)) ? "No event" : "Event") << "; ";
ss << "Auxiliary 2 status event flag: "
- << ((0 == receiverStatus & 0x40000000) ? "No event" : "Event") << "; ";
+ << ((0 == (receiverStatus & 0x40000000)) ? "No event" : "Event") << "; ";
ss << "Auxiliary 1 status event flag: "
- << ((0 == receiverStatus & 0x80000000) ? "No event" : "Event");
+ << ((0 == (receiverStatus & 0x80000000)) ? "No event" : "Event");
return ss.str();
}
}//namespace
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|