Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -r11fcfaffab49f00f358124c8c285a821632eba24 -rf37bfe2eaf910104d6edfcf46a9771871fbfbc69 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision 11fcfaffab49f00f358124c8c285a821632eba24) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision f37bfe2eaf910104d6edfcf46a9771871fbfbc69) @@ -40,23 +40,23 @@ // ********** private definitions ********** /// Macro to retrieve the FPGA sensor field based on HW type -#define GET_FPGA_SENSOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? fpgaSensorReadings.field : fpgaBeta19SensorReadings.field) +#define GET_FPGA_SENSOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ? fpgaSensorReadings.field : fpgaBeta19SensorReadings.field) //#define GET_FPGA_SENSOR_FIELD(field) (fpgaSensorReadings.field) /// Macro to retrieve the FPGA sensor field based on HW type -#define GET_FPGA_ACTUATOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? fpgaActuatorSetPoints.field : fpgaBeta19ActuatorSetPoints.field) +#define GET_FPGA_ACTUATOR_FIELD(field) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ? fpgaActuatorSetPoints.field : fpgaBeta19ActuatorSetPoints.field) //#define GET_FPGA_ACTUATOR_FIELD(field) (fpgaActuatorSetPoints.field) /// Macro to set the FPGA actuator field value based on HW type -#define SET_FPGA_ACTUATOR_FIELD(field, value) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? ( fpgaActuatorSetPoints.field = value ) : ( fpgaBeta19ActuatorSetPoints.field = value )) +#define SET_FPGA_ACTUATOR_FIELD(field, value) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ? ( fpgaActuatorSetPoints.field = value ) : ( fpgaBeta19ActuatorSetPoints.field = value )) //#define SET_FPGA_ACTUATOR_FIELD(field, value) (fpgaActuatorSetPoints.field = value) /// Macro to set the FPGA actuator bits based on HW type -#define SET_FPGA_ACTUATOR_BITS(field, bits) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? ( fpgaActuatorSetPoints.field |= bits ) : ( fpgaBeta19ActuatorSetPoints.field |= bits )) +#define SET_FPGA_ACTUATOR_BITS(field, bits) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ? ( fpgaActuatorSetPoints.field |= bits ) : ( fpgaBeta19ActuatorSetPoints.field |= bits )) //#define SET_FPGA_ACTUATOR_BITS(field, bits) (fpgaActuatorSetPoints.field |= bits) /// Macro to clear the FPGA actuator bits based on HW type -#define CLEAR_FPGA_ACTUATOR_BITS(field, bits) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ? ( fpgaActuatorSetPoints.field &= bits ) : ( fpgaBeta19ActuatorSetPoints.field &= bits )) +#define CLEAR_FPGA_ACTUATOR_BITS(field, bits) (getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ? ( fpgaActuatorSetPoints.field &= bits ) : ( fpgaBeta19ActuatorSetPoints.field &= bits )) //#define CLEAR_FPGA_ACTUATOR_BITS(field, bits) (fpgaActuatorSetPoints.field &= bits) #define FPGA_EXPECTED_ID 0x06 ///< FPGA expected ID for Beta 2 systems. @@ -1205,10 +1205,7 @@ *************************************************************************/ void setFPGAD92PumpSetStepSpeed( U32 stepSpeed ) { - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) - { - fpgaActuatorSetPoints.fpgaD92PumpSpeed = stepSpeed; - } + fpgaActuatorSetPoints.fpgaD92PumpSpeed = stepSpeed; } /*********************************************************************//** @@ -1291,11 +1288,8 @@ *************************************************************************/ void setFPGAD92PumpControl( U08 control ) { - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) - { - fpgaActuatorSetPoints.fpgaD92PumpControl &= 0x80; // preserve msb (park command bit) - fpgaActuatorSetPoints.fpgaD92PumpControl |= control; - } + fpgaActuatorSetPoints.fpgaD92PumpControl &= 0x80; // preserve msb (park command bit) + fpgaActuatorSetPoints.fpgaD92PumpControl |= control; } /*********************************************************************//** * @brief @@ -1426,10 +1420,7 @@ *************************************************************************/ void setFPGAD92PumpRevolutionCount( U32 count ) { - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) - { - fpgaActuatorSetPoints.fpgaD92PumpRevCount = count; - } + fpgaActuatorSetPoints.fpgaD92PumpRevCount = count; } /*********************************************************************//** * @brief @@ -1745,18 +1736,7 @@ *************************************************************************/ U08 getFPGAD92PumpControlStatus( void ) { - U08 result; - - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) - { - result = fpgaActuatorSetPoints.fpgaD92PumpControl; - } - else - { - result = 0; - } - - return result; + return fpgaActuatorSetPoints.fpgaD92PumpControl; } /*********************************************************************//** @@ -2607,13 +2587,13 @@ U16 result; #if 1 // Remove when Beta 1.9 is obsolete - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) == TRUE ) { - result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT1 ) ) >> BIT1; + result = fpgaBeta19SensorReadings.fpgaD63LevelSensor; } else { - result = fpgaBeta19SensorReadings.fpgaD63LevelSensor; + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT1 ) ) >> BIT1; } #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); @@ -2635,13 +2615,13 @@ U16 result; #if 1 // Remove when Beta 1.9 is obsolete - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) == TRUE ) { - result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT2 ) ) >> BIT2; + result = fpgaBeta19SensorReadings.fpgaD98LevelSensor; } else { - result = fpgaBeta19SensorReadings.fpgaD98LevelSensor; + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT2 ) ) >> BIT2; } #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); @@ -2663,13 +2643,13 @@ U16 result; #if 1 // Remove when Beta 1.9 is obsolete - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) == TRUE ) { - result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT ( BIT0 ) ) >> BIT0; + result = fpgaBeta19SensorReadings.fpgaD46LevelSensor; } else { - result = fpgaBeta19SensorReadings.fpgaD46LevelSensor; + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT ( BIT0 ) ) >> BIT0; } #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); @@ -2703,7 +2683,7 @@ { U08 result; #if 1 // Remove when Beta 1.9 is obsolete - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.fpgaConductiveLevelStatus; } @@ -2830,7 +2810,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.fpgaIOExpReadCount; } @@ -2850,7 +2830,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.fpgaIOExpERrorCount; } @@ -2869,7 +2849,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.fpgaHallSensorStatus; } @@ -2888,7 +2868,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.fpgaGPIOStatus; } @@ -2940,7 +2920,7 @@ { U32 result = 0UL; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.tempTax1; } @@ -2959,7 +2939,7 @@ { U32 result = 0UL; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.tempRTD; } @@ -2979,7 +2959,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.ad7124readcnt; } @@ -2999,7 +2979,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.ad7124errcnt; } @@ -3707,7 +3687,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.p7flowReadCount; } @@ -3727,7 +3707,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.p7flowErrorCount; } @@ -3747,7 +3727,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.p16flowReadCount; } @@ -3767,7 +3747,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) { result = fpgaSensorReadings.p16flowErrorCount; }