Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -rfd897db8177752330ad08d877e0a13620513dbdc -ra6109e69046323d34c8d92e590a07d8d4a71eb91 --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision fd897db8177752330ad08d877e0a13620513dbdc) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision a6109e69046323d34c8d92e590a07d8d4a71eb91) @@ -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. @@ -644,8 +644,8 @@ void initFPGADD( void ) { // Initialize fpga driver for beta 2 hardware - initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaBeta19SensorReadings, (U08*)&fpgaBeta19ActuatorSetPoints, - sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_BETA_1_9_T), sizeof(FPGA_ACTUATORS_BETA_1_9_T) ); + initFPGA( (U08*)&fpgaHeader, (U08*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, + sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_T), sizeof(FPGA_ACTUATORS_T) ); // initialize fpga data structures memset( &fpgaHeader, 0, sizeof( FPGA_HEADER_T ) ); @@ -2518,13 +2518,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 ); @@ -2546,14 +2546,15 @@ 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 ); #endif @@ -2574,13 +2575,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 ); @@ -2616,12 +2617,13 @@ #if 1 // Remove when Beta 1.9 is obsolete if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { - result = fpgaSensorReadings.fpgaConductiveLevelStatus; + result = fpgaBeta19SensorReadings.fpgaFloater2Status; } else { - result = fpgaBeta19SensorReadings.fpgaFloater2Status; + result = fpgaSensorReadings.fpgaConductiveLevelStatus; } + #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif @@ -2741,7 +2743,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; } @@ -2761,7 +2763,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; } @@ -2780,7 +2782,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; } @@ -2799,7 +2801,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; } @@ -2851,7 +2853,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; } @@ -2870,7 +2872,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; } @@ -2890,7 +2892,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; } @@ -2910,7 +2912,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; } @@ -3618,7 +3620,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; } @@ -3638,7 +3640,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; } @@ -3658,7 +3660,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; } @@ -3678,7 +3680,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; }