Index: firmware/App/Monitors/Level.c =================================================================== diff -u -r50144ec3e96785cf76d5bfd22ee65029c82e732b -r3393de3377c15fcbe223326fed40a840f16d7ce9 --- firmware/App/Monitors/Level.c (.../Level.c) (revision 50144ec3e96785cf76d5bfd22ee65029c82e732b) +++ firmware/App/Monitors/Level.c (.../Level.c) (revision 3393de3377c15fcbe223326fed40a840f16d7ce9) @@ -36,6 +36,10 @@ #define FPGA_LEVEL_LOW 2 ///< Floater low level status #define FPGA_LEVEL_MEDIUM 0 ///< Floater medium level status #define FPGA_LEVEL_HIGH 4 ///< Floater high level status +#define FPGA_B2_LEVEL_EMPTY 0xB ///< Floater empty level status for beta 2.0 +#define FPGA_B2_LEVEL_LOW 0xA ///< Floater low level status for beta 2.0 +#define FPGA_B2_LEVEL_MEDIUM 8 ///< Floater medium level status for beta 2.0 +#define FPGA_B2_LEVEL_HIGH 0xC ///< Floater high level status for beta 2.0 #define LEVEL_COUNT_LOW 0xFFFF ///< Level sensor count when fluid level is low or non submerged #define LEVEL_COUNT_HIGH_START 0x0000 ///< Start range of level sensor count when fluid level is high or submerged #define LEVEL_COUNT_HIGH_END 0x2FFF ///< End range of level sensor count when fluid level is high or submerged @@ -270,7 +274,7 @@ if ( D6_LEVL == levelId ) { levelStatus = getFPGAD6LevelStatus(); - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) != TRUE && getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE ) { // Beta 1.9 behavior if ( FPGA_LEVEL_EMPTY == levelStatus ) @@ -295,6 +299,31 @@ currentLevelStatus = LEVEL_STATE_ILLEGAL; } } + else if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + // Beta 2.0 behavior + if ( FPGA_B2_LEVEL_EMPTY == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_EMPTY; + } + else if ( FPGA_B2_LEVEL_LOW == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_LOW; + } + else if ( FPGA_B2_LEVEL_MEDIUM == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_MEDIUM; + } + else if ( FPGA_B2_LEVEL_HIGH == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_HIGH; + } + else + { + // TODO - Handle invalid level alarm + currentLevelStatus = LEVEL_STATE_ILLEGAL; + } + } else { // Beta 1.0 behavior @@ -322,7 +351,7 @@ { levelStatus = getFPGAP25FloaterState(); - if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) != TRUE ) + if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_1_0_HW ) != TRUE && getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) != TRUE) { // Beta 1.9 behavior if ( FPGA_LEVEL_EMPTY == levelStatus ) @@ -347,6 +376,31 @@ currentLevelStatus = LEVEL_STATE_ILLEGAL; } } + else if ( getTestConfigStatus( TEST_CONFIG_DD_FP_ENABLE_BETA_2_0_HW ) == TRUE ) + { + // Beta 2.0 behavior + if ( FPGA_B2_LEVEL_EMPTY == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_EMPTY; + } + else if ( FPGA_B2_LEVEL_LOW == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_LOW; + } + else if ( FPGA_B2_LEVEL_MEDIUM == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_MEDIUM; + } + else if ( FPGA_B2_LEVEL_HIGH == levelStatus ) + { + currentLevelStatus = LEVEL_STATE_HIGH; + } + else + { + // TODO - Handle invalid level alarm + currentLevelStatus = LEVEL_STATE_ILLEGAL; + } + } else { // Beta 1.0 behavior