Index: firmware/App/Drivers/ConductivityTeensy.c =================================================================== diff -u -r46a42611591cb92eef5f20c8d39964d406c5c8cc -r202978f0c2f12bf5a1e466d6788e3a6fc6243569 --- firmware/App/Drivers/ConductivityTeensy.c (.../ConductivityTeensy.c) (revision 46a42611591cb92eef5f20c8d39964d406c5c8cc) +++ firmware/App/Drivers/ConductivityTeensy.c (.../ConductivityTeensy.c) (revision 202978f0c2f12bf5a1e466d6788e3a6fc6243569) @@ -181,13 +181,13 @@ static COND_PARSE_STATUS parseEEPROMdata( const U08 *buffer, U32 len ); static COND_PARSE_STATUS parseConductivityMeasurements( const U08 *buffer ); -static U32 getTeensyCondId( CONDUCTIVITY_SENSORS_T sensorId ); -static void calculateConductivity( TEENSY_SENSOR_INDEX_T sensorNum ); -static void calculateConductivityAly( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ); -static void calculateConductivityUpdatedStandard( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ); -static void calculateConductivityStandard( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ); -static void calculateTemperature( TEENSY_SENSOR_INDEX_T sensorNum ); -static void calculateResistance( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ); +static U32 getTeensyCondId( U32 sensorId ); +static void calculateConductivity( U32 sensorNum ); +static void calculateConductivityAly( U32 sensorNum, BOOL isFPSensor ); +static void calculateConductivityUpdatedStandard( U32 sensorNum, BOOL isFPSensor ); +static void calculateConductivityStandard( U32 sensorNum, BOOL isFPSensor ); +static void calculateTemperature( U32 sensorNum ); +static void calculateResistance( U32 sensorNum, BOOL isFPSensor ); /*********************************************************************//** * @brief @@ -837,16 +837,15 @@ static COND_COMM_STATE_T rxInitSensor( void ) { COND_COMM_STATE_T state = COND_COMM_STATE_RX; - COND_INIT_STATUS_T initStatusInProgress = COND_INIT_STATUS_FAILED; // set to fail for testing COND_INIT_STATUS_T initStatusInitialized = COND_INIT_STATUS_FAILED; // if data populates BOOL recvComplete = rxTeensyReadRsp( TEENSY_CMD_INIT_SENSOR ); if ( TRUE == recvComplete ) { // Reset the timer for next use. condResponseTime = 0; - // Read the data from the receive buffer - initStatusInProgress = ( COND_INIT_STATUS_T )condRxBuffer[ 0 ]; + // Read the data from the receive buffer. Pull 2nd byte as first byte is + // discarded. initStatusInitialized = ( COND_INIT_STATUS_T )condRxBuffer[ 1 ]; // Store the init status @@ -1811,7 +1810,7 @@ * @param sensorId - Id of DD Conductivity Sensors * @return sensorNum - Sensor Index. *************************************************************************/ -static U32 getTeensyCondId( CONDUCTIVITY_SENSORS_T sensorId ) +static U32 getTeensyCondId( U32 sensorId ) { U32 sensorNum = 0; @@ -1853,7 +1852,7 @@ * @param sensorId ID of conductivity sensor to get conductivity. * @return The current conductivity of a given conductivity sensor. *************************************************************************/ -F32 getTeensyConductivityValue( CONDUCTIVITY_SENSORS_T sensorId ) +F32 getTeensyConductivityValue( U32 sensorId ) { U32 sensorNum = getTeensyCondId( sensorId ); F32 result = 0.0F; @@ -1876,7 +1875,7 @@ * @param sensorId ID of conductivity sensor to get temperature. * @return The current temperature of a given conductivity sensor. *************************************************************************/ -F32 getTeensyConductivityTemperatureValue( CONDUCTIVITY_SENSORS_T sensorId ) +F32 getTeensyConductivityTemperatureValue( U32 sensorId ) { U32 sensorNum = getTeensyCondId( sensorId ); F32 result = 0.0F; @@ -1899,7 +1898,7 @@ * @param sensorId ID of conductivity sensor to get temperature. * @return The current temperature of a given conductivity sensor. *************************************************************************/ -F32 getTeensyConductivityResistanceValue( CONDUCTIVITY_SENSORS_T sensorId ) +F32 getTeensyConductivityResistanceValue( U32 sensorId ) { U32 sensorNum = getTeensyCondId( sensorId ); F32 result = 0.0F; @@ -1922,7 +1921,7 @@ * @param isFPSensor - T/F if sensor is on FP hardware. * @return *************************************************************************/ -static void calculateConductivity( TEENSY_SENSOR_INDEX_T sensorNum ) +static void calculateConductivity( U32 sensorNum ) { BOOL isFPSensor = FALSE; @@ -1955,7 +1954,7 @@ * @param isFPSensor - T/F if sensor is on FP hardware. * @return *************************************************************************/ -static void calculateConductivityAly( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ) +static void calculateConductivityAly( U32 sensorNum, BOOL isFPSensor ) { F32 calculatedConductivity = 0.0; F32 B3 = 0.0; @@ -2008,7 +2007,7 @@ * @param isFPSensor - T/F if sensor is on FP hardware. * @return *************************************************************************/ -static void calculateConductivityUpdatedStandard( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ) +static void calculateConductivityUpdatedStandard( U32 sensorNum, BOOL isFPSensor ) { F32 calculatedConductivity = 0.0; F64 alpha = 0.0; @@ -2042,7 +2041,7 @@ * @param isFPSensor - T/F if sensor is on FP hardware. * @return *************************************************************************/ -static void calculateConductivityStandard( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ) +static void calculateConductivityStandard( U32 sensorNum, BOOL isFPSensor ) { F32 calculatedConductivity = 0.0; F64 alpha = 0.0; @@ -2086,7 +2085,7 @@ * @param isFPSensor - T/F if sensor is on FP hardware. * @return *************************************************************************/ -static void calculateResistance( TEENSY_SENSOR_INDEX_T sensorNum, BOOL isFPSensor ) +static void calculateResistance( U32 sensorNum, BOOL isFPSensor ) { F32 calculatedResistance = 0.0; @@ -2125,7 +2124,7 @@ * @param sensorNum - Teensy sensor index value. * @return *************************************************************************/ -static void calculateTemperature( TEENSY_SENSOR_INDEX_T sensorNum ) +static void calculateTemperature( U32 sensorNum ) { F32 calculatedTemperature = 0.0;