Index: firmware/App/Services/FpgaDD.c =================================================================== diff -u -ra6109e69046323d34c8d92e590a07d8d4a71eb91 -rd6d33f24b37947f0590effb2d42a5eb3e6f3028b --- firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision a6109e69046323d34c8d92e590a07d8d4a71eb91) +++ firmware/App/Services/FpgaDD.c (.../FpgaDD.c) (revision d6d33f24b37947f0590effb2d42a5eb3e6f3028b) @@ -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_1_9_HW ) != TRUE ? fpgaSensorReadings.field : fpgaBeta19SensorReadings.field) +#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) (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_1_9_HW ) != TRUE ? fpgaActuatorSetPoints.field : fpgaBeta19ActuatorSetPoints.field) +#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) (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_1_9_HW ) != TRUE ? ( fpgaActuatorSetPoints.field = value ) : ( fpgaBeta19ActuatorSetPoints.field = value )) +#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) (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_1_9_HW ) != TRUE ? ( fpgaActuatorSetPoints.field |= bits ) : ( fpgaBeta19ActuatorSetPoints.field |= bits )) +#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) (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_1_9_HW ) != TRUE ? ( fpgaActuatorSetPoints.field &= bits ) : ( fpgaBeta19ActuatorSetPoints.field &= bits )) +#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) (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*)&fpgaSensorReadings, (U08*)&fpgaActuatorSetPoints, - sizeof(FPGA_HEADER_T), sizeof(DD_FPGA_SENSORS_T), sizeof(FPGA_ACTUATORS_T) ); + 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) ); // 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_1_9_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { - result = fpgaBeta19SensorReadings.fpgaD63LevelSensor; + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT1 ) ) >> BIT1; } else { - result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT1 ) ) >> BIT1; + result = fpgaBeta19SensorReadings.fpgaD63LevelSensor; } #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); @@ -2546,15 +2546,14 @@ U16 result; #if 1 // Remove when Beta 1.9 is obsolete - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { - result = fpgaBeta19SensorReadings.fpgaD98LevelSensor; + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT2 ) ) >> BIT2; } else { - result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT( BIT2 ) ) >> BIT2; + result = fpgaBeta19SensorReadings.fpgaD98LevelSensor; } - #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif @@ -2575,13 +2574,13 @@ U16 result; #if 1 // Remove when Beta 1.9 is obsolete - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) == TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { - result = fpgaBeta19SensorReadings.fpgaD46LevelSensor; + result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT ( BIT0 ) ) >> BIT0; } else { - result = ( fpgaSensorReadings.fpgaConductiveLevelStatus & BIT ( BIT0 ) ) >> BIT0; + result = fpgaBeta19SensorReadings.fpgaD46LevelSensor; } #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); @@ -2617,13 +2616,12 @@ #if 1 // Remove when Beta 1.9 is obsolete if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { - result = fpgaBeta19SensorReadings.fpgaFloater2Status; + result = fpgaSensorReadings.fpgaConductiveLevelStatus; } else { - result = fpgaSensorReadings.fpgaConductiveLevelStatus; + result = fpgaBeta19SensorReadings.fpgaFloater2Status; } - #else result = GET_FPGA_SENSOR_FIELD( fpgaConductiveLevelStatus ); #endif @@ -2743,7 +2741,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.fpgaIOExpReadCount; } @@ -2763,7 +2761,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.fpgaIOExpERrorCount; } @@ -2782,7 +2780,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.fpgaHallSensorStatus; } @@ -2801,7 +2799,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.fpgaGPIOStatus; } @@ -2853,7 +2851,7 @@ { U32 result = 0UL; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.tempTax1; } @@ -2872,7 +2870,7 @@ { U32 result = 0UL; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.tempRTD; } @@ -2892,7 +2890,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.ad7124readcnt; } @@ -2912,7 +2910,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.ad7124errcnt; } @@ -3620,7 +3618,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.p7flowReadCount; } @@ -3640,7 +3638,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.p7flowErrorCount; } @@ -3660,7 +3658,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.p16flowReadCount; } @@ -3680,7 +3678,7 @@ { U08 result = 0U; - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_9_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) { result = fpgaSensorReadings.p16flowErrorCount; }