Index: firmware/App/Controllers/ConductivitySensors.c =================================================================== diff -u -re8c019d3d43b517cabfdfe75fa5d03749d036018 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision e8c019d3d43b517cabfdfe75fa5d03749d036018) +++ firmware/App/Controllers/ConductivitySensors.c (.../ConductivitySensors.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -179,7 +179,9 @@ } processCPiCPoSensorRead( CONDUCTIVITYSENSORS_CPI_SENSOR, getFPGACPi(), getFPGACPiReadCount(), getFPGACPiErrorCount(), getFPGACPiFault() ); +#ifndef ENABLE_DVT_BOARD processCPiCPoSensorRead( CONDUCTIVITYSENSORS_CPO_SENSOR, getFPGACPo(), getFPGACPoReadCount(), getFPGACPoErrorCount(), getFPGACPoFault() ); +#endif processCD1CD2SensorRead( getFPGAEmstatRxFifoCount(), getFPGAEmstatRxErrCount() ); if ( ++conductivityDataPublicationTimerCounter >= getU32OverrideValue( &conductivityDataPublishInterval ) ) @@ -409,7 +411,9 @@ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_COND_SENSOR_CHECK ) != SW_CONFIG_ENABLE_VALUE ) #endif { +#ifndef ENABLE_DVT_BOARD SET_ALARM_WITH_1_U32_DATA( ALARM_ID_CONDUCTIVITY_SENSOR_FAULT, sensorId ); // TODO for DVT testing +#endif } } } Index: firmware/App/Controllers/DrainPump.c =================================================================== diff -u -re8c019d3d43b517cabfdfe75fa5d03749d036018 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision e8c019d3d43b517cabfdfe75fa5d03749d036018) +++ firmware/App/Controllers/DrainPump.c (.../DrainPump.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -183,7 +183,7 @@ // If this function was called, delayed command does not need to be executed // so the pending count down is zeroed. pendingDrainPumpCmdCountDown = 0; - result = TRUE; + result = TRUE; } else { @@ -324,7 +324,7 @@ *************************************************************************/ void execDrainPumpMonitor( void ) { - U16 const fpgaADCSpeedCount = getFPGADrainPumpSpeed(); + U16 fpgaADCSpeedCount = getFPGADrainPumpSpeed(); if ( DRAIN_PUMP_OFF_RPM_ADC_COUNT == fpgaADCSpeedCount ) { @@ -346,7 +346,9 @@ BOOL isRPMTooHigh = ( getDrainPumpMeasuredRPM() > MIN_DRAIN_PUMP_RPM ? TRUE : FALSE ); checkPersistentAlarm( ALARM_ID_DRAIN_PUMP_RPM_OUT_OF_RANGE, FALSE, getDrainPumpMeasuredRPM(), MAX_ALLOWED_OPEN_LOOP_RPM_OUT_OF_RANGE ); +#ifndef ENABLE_DVT_BOARD checkPersistentAlarm( ALARM_ID_DRAIN_PUMP_OFF_FAULT, isRPMTooHigh, getDrainPumpMeasuredRPM(), MIN_DRAIN_PUMP_RPM ); // TODO DVT +#endif // If the off fault alarm has become active, trigger the safety shutdown if ( TRUE == isAlarmActive( ALARM_ID_DRAIN_PUMP_OFF_FAULT ) ) @@ -363,8 +365,10 @@ // Check if RPM is out of range BOOL isRPMOutOfRange = ( rpmDiff > MAX_ALLOWED_OPEN_LOOP_RPM_OUT_OF_RANGE ? TRUE : FALSE ); +#ifndef ENABLE_DVT_BOARD checkPersistentAlarm( ALARM_ID_DRAIN_PUMP_RPM_OUT_OF_RANGE, isRPMOutOfRange, getDrainPumpMeasuredRPM(), MAX_ALLOWED_OPEN_LOOP_RPM_OUT_OF_RANGE ); checkPersistentAlarm( ALARM_ID_DRAIN_PUMP_OFF_FAULT, FALSE, getDrainPumpMeasuredRPM(), MIN_DRAIN_PUMP_RPM ); // TODO DVT +#endif } else { Index: firmware/App/Controllers/Heaters.c =================================================================== diff -u -re8c019d3d43b517cabfdfe75fa5d03749d036018 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision e8c019d3d43b517cabfdfe75fa5d03749d036018) +++ firmware/App/Controllers/Heaters.c (.../Heaters.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -65,10 +65,10 @@ #define HEATERS_VOLTAGE_OUT_OF_RANGE_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Heaters voltage out of range time out in milliseconds. #define HEATERS_MAX_VOLTAGE_OUT_OF_RANGE_TOL 0.2F ///< Heaters max voltage out of range tolerance. #define HEATERS_MIN_RAMP_TIME_MS ( 6 * MS_PER_SECOND ) ///< Heaters minimum time that they have to stay in the ramp state in milliseconds. -#define TEMPERATURES_MOVING_AVG_SIZE 3U ///< Heaters ramp state temperatures moving average size. +#define TRIMMER_HEATER_MAX_POWER_W 66.5F ///< Trimmer heater maximum power in Watts. #define DELTA_TEMPERATURE_TIME_COSNTANT_C 8.6F ///< Delta temperature calculated from time constant. -#define MAXIMUM_ALLOWED_TARGET_TEMPERATURE_DEVIATION_C 0.25F ///< Maximum allowed temperature deviation from target temperature in C. +#define MAXIMUM_ALLOWED_TARGET_TEMPERATURE_DEVIATION_C 2.5F ///< Maximum allowed temperature deviation from target temperature in C. #define PRIMARY_HEATER_DUTY_CYCLE_PER_TEMPERATURE_C 0.03F ///< Primary heaters duty cycle per temperature in C. #define DATA_PUBLISH_COUNTER_START_COUNT 70 ///< Data publish counter start count. @@ -100,6 +100,7 @@ F32 heaterEfficiency; ///< Heater efficiency during the run. BOOL hasTargetBeenReached; ///< Heater flag to indicate whether the target temperature has been reached. F32 calculatedTemperature; ///< Heater calculated temperature. + DG_RESERVOIR_ID_T inactiveRsrvr; ///< Heater inactive reservoir. } HEATER_STATUS_T; static HEATER_STATUS_T heatersStatus[ NUM_OF_DG_HEATERS ]; ///< Heaters status. @@ -438,7 +439,6 @@ // Update the calculated target temperature heatersStatus[ DG_PRIMARY_HEATER ].calculatedTemperature = targetTemperature; - setHeaterDutyCycle( heater, dutyCycle ); return state; @@ -545,7 +545,7 @@ // Update the calculated target temperature heatersStatus[ DG_TRIMMER_HEATER ].calculatedTemperature = currentTemperature; - + heatersStatus[ DG_TRIMMER_HEATER ].inactiveRsrvr = getInactiveReservoir(); setHeaterDutyCycle( heater, dutyCycle ); return state; @@ -562,9 +562,10 @@ static HEATERS_STATE_T handleHeaterStateTrimmerControlToTarget( void ) { HEATERS_STATE_T state = HEATER_EXEC_STATE_TRIMMER_CONTROL_TO_TARGET; - DG_HEATERS_T heater = DG_TRIMMER_HEATER; - if ( TRUE == haveHeaterControlConditionsChanged( heater ) ) // TODO do we need this kind of check from trimmer?? + // If the inactive reservoir has changed from the last run transition to ramp state to recalculate the + // duty cycle for the next delivery + if ( heatersStatus[ DG_TRIMMER_HEATER ].inactiveRsrvr != getInactiveReservoir() ) { state = HEATER_EXEC_STATE_TRIMMER_RAMP_TO_TARGET; } @@ -640,7 +641,7 @@ heaterEfficiency += ( primaryTargetTemperature - lastFillTemperature ) * PRIMARY_HEATER_DUTY_CYCLE_PER_TEMPERATURE_C; } - heaterEfficiency = heaterEfficiency <= 0.0 ? 0.0 : heaterEfficiency; + heaterEfficiency = ( heaterEfficiency <= 0.0 ? 0.0 : heaterEfficiency ); // Update the heaters efficiency heatersStatus[ DG_PRIMARY_HEATER ].heaterEfficiency = heaterEfficiency; @@ -678,14 +679,17 @@ F32 heaterEfficiency = heatersStatus[ DG_TRIMMER_HEATER ].heaterEfficiency; F32 dutyCycle = 0.0; -#ifndef DISABLE_HEATERS_EFFICIENCY - if ( TRUE == checkEfficiency ) +#ifndef _RELEASE_ + if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_HEATERS_EFFICIENCY ) != SW_CONFIG_ENABLE_VALUE ) +#endif { - // TODO Do we need to recalculate the efficiency? + if ( TRUE == checkEfficiency ) + { + // TODO Do we need to recalculate the efficiency? + } } -#endif - dutyCycle = flow * WATER_SPECIFIC_HEAT_DIVIDED_BY_MINUTES * ( targetTemperature - currentTemperature ) * heaterEfficiency; + dutyCycle = ( flow * WATER_SPECIFIC_HEAT_DIVIDED_BY_MINUTES * ( targetTemperature - currentTemperature ) * heaterEfficiency ) / TRIMMER_HEATER_MAX_POWER_W; // Check the boundaries of the calculated duty cycle dutyCycle = MIN( dutyCycle, HEATERS_MAX_DUTY_CYCLE ); @@ -714,7 +718,7 @@ if ( ( TRUE == hasFlowChanged ) || ( TRUE == heatersStatus[ heater ].hasTargetTempChanged ) ) { status = TRUE; - heatersStatus[ heater ].targetFlow = targetFlow; + heatersStatus[ heater ].targetFlow = targetFlow; heatersStatus[ heater ].hasTargetTempChanged = FALSE; } Index: firmware/App/Controllers/TemperatureSensors.c =================================================================== diff -u -re8c019d3d43b517cabfdfe75fa5d03749d036018 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision e8c019d3d43b517cabfdfe75fa5d03749d036018) +++ firmware/App/Controllers/TemperatureSensors.c (.../TemperatureSensors.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -963,7 +963,9 @@ // Check both temperature and to be in range if ( ( temperature < TEMP_SENSORS_MIN_ALLOWED_DEGREE_C ) || ( temperature > tempSensors[ sensorIndex ].maxAllowedTemperature ) ) { +#ifndef ENABLE_DVT_BOARD checkPersistentAlarm( ALARM_ID_DG_TEMPERATURE_SENSOR_OUT_OF_RANGE, TRUE, sensorIndex, temperature ); +#endif } } } Index: firmware/App/DGCommon.h =================================================================== diff -u -rd87597d070708c06aae556d2688b40d99341ad38 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/DGCommon.h (.../DGCommon.h) (revision d87597d070708c06aae556d2688b40d99341ad38) +++ firmware/App/DGCommon.h (.../DGCommon.h) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -41,7 +41,7 @@ #define DISABLE_RTC_CONFIG 1 // Not needed TODO investigate and remove -// #define ENABLE_DVT_BOARD 1 // TODo can we make this a sw config? +// #define ENABLE_DVT_BOARD 1 // TODo can we make this a sw config? TODO remove #include #include Index: firmware/App/Services/FPGA.c =================================================================== diff -u -rf91baac9704a90ab0fea1dd05e11833ffc5a5a4e -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision f91baac9704a90ab0fea1dd05e11833ffc5a5a4e) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -120,13 +120,8 @@ U32 fpgaTDi; ///< Reg 308. ADC TDi channel 0 - temperature U32 fpgaTDiTemp; ///< Reg 312. ADC TDi channel 1 - internal temperature -#ifndef ENABLE_DVT_BOARD U32 fpgaCPo; ///< Reg 316. CPo conductivity sensor value U32 fpgaCPi; ///< Reg 320. CPi conductivity sensor value -#else - U32 fpgaTHDi; ///< Reg 316. ADC THD channel 0 - temperature - U32 fpgaTHDiTemp; ///< Reg 320. ADC THD channel 1 - internal temperature -#endif U16 fpgaPrimaryHeaterIntTemp; ///< Reg 324. Primary heater temperature U16 fpgaPrimaryHeaterIntJunctionTemp; ///< Reg 326. Primary heater internal temperature @@ -162,7 +157,6 @@ U08 fpgaTrimmerHeaterFlags; ///< Reg 366. Trimmer heater flags U08 fpgaTrimmerHeaterReadCnt; ///< Reg 367. Trimmer heater read count -#ifndef ENABLE_DVT_BOARD U08 fpgaCPoFault; ///< Reg 368. CPo conductivity sensor fault U08 fpgaCPoReadCnt; ///< Reg 369. CPo conductivity sensor read count U08 fpgaCPoErrorCnt; ///< Reg 370. CPo conductivity sensor error count @@ -171,25 +165,17 @@ U08 fpgaCPiErrorCnt; ///< Reg 373. CPi conductivity sensor error count U08 fpgaCP1CP2Fault; ///< Reg 374. Concentrate pump fault register for CP1 and CP2 U08 fpgaReserved1; ///< Reg 375. Reserved -#else - U08 fpgaCPiCPoEmstatOutByte; ///< Reg 368. CPi/CPo Emstat output FIFO - U08 fpgaCPiCPoEmstatRxErrCount; ///< Reg 369. CPi/CPo Emstat receive error count - U16 fpgaCPiCPoEmstatTxFIFOCount; ///< Reg 370. CPi/CPo Emstat transmit FIFO count - U16 fpgaCPiCPoEmstatRxFIFOCount; ///< Reg 372. CPi/CPo Emstat receive FIFO count - U08 fpgaCP1CP2Fault; ///< Reg 374. Concentrate pump fault register for CP1 and CP2 - U08 fpgaDRPHallStatus; ///< Reg 375. Drain pump hall sensor status -#endif U16 fpgaValveStates; ///< Reg 376. Valves states U16 fpgaFanIn1Pulse; ///< Reg 378. Fan inlet 1 pulse time in 2.5 us resolution U16 fpgaFanOut1Pulse; ///< Reg 380. Fan outlet 1 pulse time in 2.5 us resolution - U08 fpgaEmstatOutByte; ///< Reg 382. Emstat output FIFO - data from the Emstat device - U08 fpgaEmstatRxErrorCount; ///< Reg 383. Number of receive errors since power-up - U16 fpgaEmstatTxFifoCount; ///< Reg 384. Number of bytes in the Emstat Tx FIFO buffer - U16 fpgaEmstatRxFifoCount; ///< Reg 386. Number of bytes in the Emstat Rx FIFO buffer - U16 fpgaCP1HallSense; ///< Reg 388. Concentrate pump CP1 hall sensor pulse width. - U16 fpgaCP2HallSense; ///< Reg 390. Concentrate pump CP2 hall sensor pulse width. + U08 fpgaCD1CD2EmstatOutByte; ///< Reg 382. Emstat output FIFO - data from the Emstat device + U08 fpgaCD1CD2EmstatRxErrorCount; ///< Reg 383. Number of receive errors since power-up + U16 fpgaCD1CD2EmstatTxFifoCount; ///< Reg 384. Number of bytes in the Emstat Tx FIFO buffer + U16 fpgaCD1CD2EmstatRxFifoCount; ///< Reg 386. Number of bytes in the Emstat Rx FIFO buffer + U16 fpgaCP1HallSense; ///< Reg 388. Concentrate pump CP1 hall sensor pulse width + U16 fpgaCP2HallSense; ///< Reg 390. Concentrate pump CP2 hall sensor pulse width U08 fpgaGPIO; ///< Reg 392. FGPA GPIO register U08 fpgaDummyByte2Addr; ///< Reg 393. Dummy byte address to maintain an even addressing scheme @@ -199,21 +185,17 @@ U16 fpgaFanOut2Pulse; ///< Reg 398. Fan outlet 2 pulse time in 2.5 resolution U16 fpgaFanIn3Pulse; ///< Reg 400. Fan inlet 3 pulse time in 2.5 resolution U16 fpgaFanOut3Pulse; ///< Reg 402. Fan outlet 3 pulse time in 2.5 resolution - U16 fpgaTimerCount_ms; ///< Reg 404. Internal FPGA timer count in ms. + U16 fpgaTimerCountMS; ///< Reg 404. Internal FPGA timer count in milliseconds U16 fpgaADCVccInt; ///< Reg 406. Internal FPGA Vcc Voltage. - U16 fpgaADCVccAux; ///< Reg 408. Internal FPGA Vcc auxiliary voltage. - U16 fpgaADCVPVN; ///< Reg 410. Internal FPGA VPVN voltage. + U16 fpgaADCVccAux; ///< Reg 408. Internal FPGA Vcc auxiliary voltage + U16 fpgaADCVPVN; ///< Reg 410. Internal FPGA VPVN voltage - // DVT only + // DVT changes U08 fpgaBaroReadCount; ///< Reg 412. Barometric sensor read count U08 fpgaBaroErroCount; ///< Reg 413. Barometric sensor error count - // DVT only - - U16 fpgaDrainPumpSpeedFeedback; ///< Reg 414. Drain pump speed feedback. - U16 fpgaDrainPumpCurrentFeedback; ///< Reg 416. Drain pump current feedback. + U16 fpgaDrainPumpSpeedFeedback; ///< Reg 414. Drain pump speed feedback + U16 fpgaDrainPumpCurrentFeedback; ///< Reg 416. Drain pump current feedback U16 fpgaDialysateFlowRate; ///< Req 418. Dialysate flow rate measurement - - // DVT only U16 fpgaHeaterGateADC; ///< Reg 420. Heater gate ADC U16 fpgaHeaterGNDADC; ///< Reg 422. Heater ground ADC U08 fpgaHeater1ADCReadCount; ///< Reg 424. Heater 1 ADC read count @@ -230,7 +212,14 @@ U32 fpgaBaroTemperature; ///< Reg 446. Barometric sensor temperature sensor U08 fpgaTHDRTDReadCount; ///< Reg 450. THD RTD read count U08 fpgaTHDRTDErrorCount; ///< Reg 451. THD RTD error count - // DVT only + U32 fpgaTHDReadData0; ///< Reg 452. THD channel 0 read data + U32 fpgaTHDReadData1; ///< Reg 456. THD channel 1 read data + U08 fpgaCPiCPoEmstatOutByte; ///< Reg 460. CPi/CPo Emstat out byte + U08 fpgaCPiCPoEmstatRxErrCount; ///< Reg 461. CPi/CPo Emstat Rx error count + U16 fpgaCPiCPoEmstatTxFIFOCount; ///< Reg 462. CPi/CPo Emstat Tx FIFO count + U16 fpgaCPiCPoEmstatRxFIFOCount; ///< Reg 464. CPi/CPo Emstat Rx FIFO count + U08 fpgaDrainPumpFrequency; ///< Reg 466. drain pump frequency + U16 fpgaDrainPumpHallSnsrStatus; ///< Reg 468. drain pump hall sensor status } DG_FPGA_SENSORS_T; typedef struct @@ -247,13 +236,70 @@ U16 fpgaCP2StepSpeed; ///< Reg 26. Concentrate pump CP2 step speed register U08 fpgaCP2Control; ///< Reg 28. Concentrate pump CP2 control register U08 fpgaEmstatControl; ///< Reg 29. Emstat conductivity sensor control register + U16 fpgaVRfPWMLow; ///< Reg 30. VRf PWM low + U16 fpgaVRfPWMPeriod; ///< Reg 32. VRf PWM period + U16 fpgaVRiPWMLow; ///< Reg 34. VRi PWM low + U16 fpgaVRiPWMPeriod; ///< Reg 36. VRi PWM period + U16 fpgaVRdPWMLow; ///< Reg 38. VRd PWM low + U16 fpgaVRdPWMPeriod; ///< Reg 40. VRD PWM period + U16 fpgaVRoPWMLow; ///< Reg 42. VRo PWM low + U16 fpgaVRoPWMPeriod; ///< Reg 44. VRo PWM period + U16 fpgaVPoPWMLow; ///< Reg 46. VPo PWM low + U16 fpgaVPoPWMPeriod; ///< Reg 48. VPo PWM period + U16 fpgaVBfPWMLow; ///< Reg 50. VBf PWM low + U16 fpgaVBFPWMPeriod; ///< Reg 52. VBf PWM period + U16 fpgaVRcPWMLow; ///< Reg 54. VRc PWM low + U16 fpgaVRcPWMPeriod; ///< Reg 56. VRc PWM period + U16 fpgaVDrPWMLow; ///< Reg 58. VDr PWM Low + U16 fpgaVDrPWMPeriod; ///< Reg 60. VDr PWM period + U16 fpgaVPiPWMLow; ///< Reg 62. VPi PWM low + U16 fpgaVPiPWMPeriod; ///< Reg 64. VPi PWM period + U16 fpgaVSPPWMLow; ///< Reg 66. VSP PWM low + U16 fpgaVSPPWMPeriod; ///< Reg 68. VSP PWM period + U16 fpgaVRd1PWMLow; ///< Reg 70. VRd1 PWM low + U16 fpgaVRd1PWMPeriod; ///< Reg 72. VRd1 PWM period + U16 fpgaVRd2PWMLow; ///< Reg 74. VRd2 PWM low + U16 fpgaVRd2PWMPeriod; ///< Reg 76. VRd2 PWM period + U16 fpgaVPdPWMLow; ///< Reg 78. VPd PWM low + U16 fpgaVPdPWMPeriod; ///< Reg 80. VPd PWM period + U16 fpgaVSOLPWMLow; ///< Reg 82. VSOL PWM low + U16 fpgaVSOLPWMPeriod; ///< Reg 84. VSOL PWM period + U16 fpgaVRfPWMPullin; ///< Reg 86. VRf PWM pull in + U16 fpgaVRiPWMPullin; ///< Reg 88. VRi PWM pull in + U16 fpgaVRdPWMPullin; ///< Reg 90. VRd PWM pull in + U16 fpgaVRoPWMPullin; ///< Reg 92. VRo PWM pull in + U16 fpgaVPoPWMPullin; ///< Reg 94. VPo PWM pull in + U16 fpgaVBfPWMPullin; ///< Reg 96. VBf PWM pull in + U16 fpgaVRcPWMPullin; ///< Reg 98. VRc PWM pull in + U16 fpgaVDrPWMPullin; ///< Reg 100. VDr PWM pull in + U16 fpgaVPiPWMPullin; ///< Reg 102. VPi PWM pull in + U16 fpgaVSPPWMPullin; ///< Reg 104. VSP PWM pull in + U16 fpgaVRd1PWMPullin; ///< Reg 106. VRd1 PWM pull in + U16 fpgaVRd2PWMPullin; ///< Reg 108. VRd2 PWM pull in + U16 fpgaVPdPWMPullin; ///< Reg 110. VPd PWM pull in + U16 fpgaVSPR2PWMPullin; ///< Reg 112. VSPR2 PWM pull in + U16 fpgaValvePWMEnable; ///< Reg 114. valve PWM enable + + // DVT Registers + U08 fpgaTHdControlReg; ///< Reg 116. THd control register + U08 fpgaCPiCPoEmstatControl; ///< Reg 117. CPi/CPo Emstat control + U16 fpgaDACRegBIn; ///< Reg 118. Debug DAC channel B output + U16 fpgaDACRegCIn; ///< Reg 120. Debug DAC channel C output + U16 fpgaDACRegDIn; ///< Reg 122. Debug DAC channel D output + U16 fpgaDACRegEIn; ///< Reg 124. Debug DAC channel E output + U16 fpgaDACRegFIn; ///< Reg 126. Debug DAC channel F output + U16 fpgaDACRegGIn; ///< Reg 128. Debug DAC channel G output + U16 fpgaDACRegHIn; ///< Reg 130. Debug DAC channel H output + U32 fpgaCP1StepCount; ///< Reg 132. Concentrate pump 1 step count + U32 fpgaCP2StepCount; ///< Reg 136. Concentrate pump 2 step count + U08 fgpaNewCP2Control; ///< Reg 140. Concentrate pump 2 control + U08 fpgaNewCP1Control; ///< Reg 141. Concentrate pump 1 control } FPGA_ACTUATORS_T; #pragma pack(pop) // ********** private data ********** static FPGA_STATE_T fpgaState = FPGA_STATE_START; ///< FPGA current state. - static U32 fpgaCommRetryCount = 0; ///< FPGA communication retry count. static U32 fpgaReceiptCounter = 0; ///< FPGA receipt completed counter. static U32 fpgaTransmitCounter = 0; ///< FPGA transmit completed counter. @@ -1698,7 +1744,7 @@ *************************************************************************/ U08 getFPGAEmstatOutByte( void ) { - return fpgaSensorReadings.fpgaEmstatOutByte; + return fpgaSensorReadings.fpgaCD1CD2EmstatOutByte; } /*********************************************************************//** @@ -1710,7 +1756,7 @@ *************************************************************************/ U08 getFPGAEmstatRxErrCount( void ) { - return fpgaSensorReadings.fpgaEmstatRxErrorCount; + return fpgaSensorReadings.fpgaCD1CD2EmstatRxErrorCount; } /*********************************************************************//** @@ -1723,7 +1769,7 @@ *************************************************************************/ U16 getFPGAEmstatRxFifoCount( void ) { - return fpgaSensorReadings.fpgaEmstatRxFifoCount; + return fpgaSensorReadings.fpgaCD1CD2EmstatRxFifoCount; } /*********************************************************************//** @@ -1954,7 +2000,7 @@ *************************************************************************/ U16 getFPGATimerCount( void ) { - return fpgaSensorReadings.fpgaTimerCount_ms; + return fpgaSensorReadings.fpgaTimerCountMS; } /*********************************************************************//** @@ -2126,4 +2172,6 @@ return ( fpgaSensorReadings.fpgaBaroTemperature & MASK_OFF_U32_MSB ); } +/****************************DVT Functions*******************************************/ + /**@}*/ Index: firmware/App/Services/FPGA.h =================================================================== diff -u -rf91baac9704a90ab0fea1dd05e11833ffc5a5a4e -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Services/FPGA.h (.../FPGA.h) (revision f91baac9704a90ab0fea1dd05e11833ffc5a5a4e) +++ firmware/App/Services/FPGA.h (.../FPGA.h) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -153,6 +153,8 @@ U32 getFPGABaroPressure( void ); U32 getFPGABaroTemperature( void ); +// DVT functions + /**@}*/ #endif Index: firmware/App/Services/Reservoirs.c =================================================================== diff -u -re8c019d3d43b517cabfdfe75fa5d03749d036018 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision e8c019d3d43b517cabfdfe75fa5d03749d036018) +++ firmware/App/Services/Reservoirs.c (.../Reservoirs.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -99,7 +99,7 @@ static DG_RESERVOIR_VOLUME_RECORD_T reservoirsCalRecord; ///< DG reservoirs non-volatile record. static DG_HEATING_CAL_RECORD_T heatingConstsCalRecord; ///< DG heating calibration record. static F32 targetFillFlowRateLPM; ///< Target fill flow rate in L/min. -static BOOL isThisTheFirstCycle = TRUE; ///< Boolean flag to indicate whether this is the first cycle. +static BOOL isThisTheFirstCycle; ///< Boolean flag to indicate whether this is the first cycle. static RESERVOIRS_PREVIOUS_STATUS reservoirPreviousStatus[ NUM_OF_DG_RESERVOIRS ]; ///< Reservoirs previous status. /*********************************************************************//** @@ -147,8 +147,7 @@ // publish active reservoir, fill/drain volume targets at 1 Hz. if ( ++dataPublishCounter >= RESERVOIR_DATA_PUB_INTERVAL ) { - RESERVOIR_DATA_T data; - + RESERVOIR_DATA_T data; data.activeReservoir = getU32OverrideValue( &activeReservoir ); data.fillToVolumeMl = getU32OverrideValue( &fillVolumeTargetMl ); data.drainToVolumeMl = getU32OverrideValue( &drainVolumeTargetMl ); @@ -209,9 +208,8 @@ void setActiveReservoirCmd( DG_RESERVOIR_ID_T resID ) { DG_CMD_RESPONSE_T cmdResponse; - - cmdResponse.commandID = DG_CMD_SWITCH_RESERVOIR; - cmdResponse.rejected = TRUE; + cmdResponse.commandID = DG_CMD_SWITCH_RESERVOIR; + cmdResponse.rejected = TRUE; cmdResponse.rejectCode = DG_CMD_REQUEST_REJECT_REASON_NONE; // switch reservoir command only valid in generation idle mode Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -re8c019d3d43b517cabfdfe75fa5d03749d036018 -r38c28a43b71d21d72906b07e9d60107b84bffb37 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision e8c019d3d43b517cabfdfe75fa5d03749d036018) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 38c28a43b71d21d72906b07e9d60107b84bffb37) @@ -655,7 +655,9 @@ if ( TRUE == didTimeout( timeOfLastHDCheckIn, HD_COMM_TIMEOUT_IN_MS ) ) { hdCommunicationStatus.data = FALSE; +#ifndef ENABLE_DVT_BOARD activateAlarmNoData( ALARM_ID_HD_COMM_TIMEOUT ); // TODO DVT +#endif } }