Index: firmware/App/Controllers/BloodFlow.c =================================================================== diff -u -r57ee0134869672b53ab5b7146b8988ede8f828d6 -r6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b --- firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 57ee0134869672b53ab5b7146b8988ede8f828d6) +++ firmware/App/Controllers/BloodFlow.c (.../BloodFlow.c) (revision 6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b) @@ -652,7 +652,11 @@ if ( ++bloodFlowDataPublicationTimerCounter > getPublishBloodFlowDataInterval() ) { S32 flowStPt = (S32)getTargetBloodFlowRate(); +#ifndef SHOW_RAW_FLOW_VALUES F32 measFlow = getMeasuredBloodFlowRate(); +#else + F32 measFlow = getFPGABloodFlow(); +#endif F32 measRotSpd = getMeasuredBloodPumpRotorSpeed(); F32 measSpd = getMeasuredBloodPumpSpeed(); F32 measMCSpd = getMeasuredBloodPumpMCSpeed(); @@ -827,7 +831,9 @@ bpCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; if ( bpCurrErrorDurationCtr > BP_MAX_CURR_ERROR_DURATION_MS ) { +#ifndef DISABLE_MOTOR_CURRENT_ERRORS SET_ALARM_WITH_1_F32_DATA( ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK, getMeasuredBloodPumpMCCurrent() ); +#endif } } else @@ -844,7 +850,9 @@ bpCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; if ( bpCurrErrorDurationCtr > BP_MAX_CURR_ERROR_DURATION_MS ) { +#ifndef DISABLE_MOTOR_CURRENT_ERRORS SET_ALARM_WITH_1_F32_DATA( ALARM_ID_BLOOD_PUMP_MC_CURRENT_CHECK, getMeasuredBloodPumpMCCurrent() ); +#endif } } else Index: firmware/App/Controllers/DialInFlow.c =================================================================== diff -u -r57ee0134869672b53ab5b7146b8988ede8f828d6 -r6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b --- firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 57ee0134869672b53ab5b7146b8988ede8f828d6) +++ firmware/App/Controllers/DialInFlow.c (.../DialInFlow.c) (revision 6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b) @@ -653,7 +653,11 @@ if ( ++dialInFlowDataPublicationTimerCounter > getPublishDialInFlowDataInterval() ) { S32 flowStPt = (S32)getTargetDialInFlowRate(); +#ifndef SHOW_RAW_FLOW_VALUES F32 measFlow = getMeasuredDialInFlowRate(); +#else + F32 measFlow = getFPGADialysateFlow(); +#endif F32 measRotSpd = getMeasuredDialInPumpRotorSpeed(); F32 measSpd = getMeasuredDialInPumpSpeed(); F32 measMCSpd = getMeasuredDialInPumpMCSpeed(); @@ -811,7 +815,9 @@ dipCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; if ( dipCurrErrorDurationCtr > DIP_MAX_CURR_ERROR_DURATION_MS ) { +#ifndef DISABLE_MOTOR_CURRENT_ERRORS SET_ALARM_WITH_1_F32_DATA( ALARM_ID_DIAL_IN_PUMP_MC_CURRENT_CHECK, getMeasuredDialInPumpMCCurrent() ); +#endif } } else @@ -828,7 +834,9 @@ dipCurrErrorDurationCtr += TASK_PRIORITY_INTERVAL; if ( dipCurrErrorDurationCtr > DIP_MAX_CURR_ERROR_DURATION_MS ) { +#ifndef DISABLE_MOTOR_CURRENT_ERRORS SET_ALARM_WITH_1_F32_DATA( ALARM_ID_DIAL_IN_PUMP_MC_CURRENT_CHECK, getMeasuredDialInPumpMCCurrent() ); +#endif } } else Index: firmware/App/Controllers/DialOutFlow.c =================================================================== diff -u -r926afe9b1d9cc6931cbca48080e4a66385a20239 -r6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b --- firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 926afe9b1d9cc6931cbca48080e4a66385a20239) +++ firmware/App/Controllers/DialOutFlow.c (.../DialOutFlow.c) (revision 6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b) @@ -610,7 +610,7 @@ { dialOutBroadCastVariables.refUFVolMl = getTotalTargetDialOutUFVolumeInMl(); dialOutBroadCastVariables.measUFVolMl = getTotalMeasuredUFVolumeInMl(); - dialOutBroadCastVariables.measRotSpdRPM = getMeasuredDialOutPumpRotorSpeed(); + dialOutBroadCastVariables.measRotSpdRPM = getLoadCellWeightInGrams( LOAD_CELL_RESERVOIR_1_PRIMARY ); //getMeasuredDialOutPumpRotorSpeed(); // TODO - restore to rotor speed later dialOutBroadCastVariables.measSpdRPM = getMeasuredDialOutPumpSpeed(); dialOutBroadCastVariables.measMCSpdRPM = getMeasuredDialOutPumpMCSpeed(); dialOutBroadCastVariables.measMCCurrmA = getMeasuredDialOutPumpMCCurrent(); Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r57ee0134869672b53ab5b7146b8988ede8f828d6 -r6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 57ee0134869672b53ab5b7146b8988ede8f828d6) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b) @@ -84,7 +84,7 @@ requestNewOperationMode( MODE_PRES ); } #ifdef RM46_EVAL_BOARD_TARGET - if ( TRUE == didTimeout( start, 10000U ) ) + if ( TRUE == didTimeout( start, 5000U ) ) { requestNewOperationMode( MODE_PRES ); } Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r57ee0134869672b53ab5b7146b8988ede8f828d6 -r6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 57ee0134869672b53ab5b7146b8988ede8f828d6) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b) @@ -22,6 +22,7 @@ #include "DialOutFlow.h" #include "Dialysis.h" #include "Buttons.h" +#include "TaskGeneral.h" #include "OperationModes.h" #include "SystemCommMessages.h" #include "Timers.h" @@ -34,6 +35,8 @@ // ********** private definitions ********** +#define TREATMENT_TIME_DATA_PUB_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) // interval (ms/task time) at which the treatment time data is published on the CAN bus + typedef enum Treatment_States { TREATMENT_START_STATE = 0, @@ -59,6 +62,7 @@ static U32 treatmentTimeMS; static U32 lastTreatmentTimeStamp; +static U32 treatmentTimeBroadcastTimerCtr; #ifdef UF_TEST_ENABLED static BUTTON_STATE_T lastOffButtonState = BUTTON_STATE_RELEASED; @@ -82,6 +86,10 @@ void initTreatmentMode( void ) { currentTreatmentState = TREATMENT_START_STATE; + + treatmentTimeMS = 0; + lastTreatmentTimeStamp = 0; + treatmentTimeBroadcastTimerCtr = 0; } /************************************************************************* @@ -182,13 +190,18 @@ elapsedTreatmentTimeInSecs = presTreatmentTimeSecs; currentTreatmentState = TREATMENT_END_STATE; } - broadcastTreatmentTime( presTreatmentTimeSecs, elapsedTreatmentTimeInSecs, presTreatmentTimeSecs - elapsedTreatmentTimeInSecs ); + // broadcast treatment time at interval + if ( ++treatmentTimeBroadcastTimerCtr >= TREATMENT_TIME_DATA_PUB_INTERVAL ) + { + broadcastTreatmentTime( presTreatmentTimeSecs, elapsedTreatmentTimeInSecs, presTreatmentTimeSecs - elapsedTreatmentTimeInSecs ); + treatmentTimeBroadcastTimerCtr = 0; + } #endif #ifdef RM46_EVAL_BOARD_TARGET // TODO - temporary test code for eval board - move to next mode after 10 sec if ( TRUE == didTimeout( start, 10000U ) ) { - requestNewOperationMode( MODE_POST ); +// requestNewOperationMode( MODE_POST ); } #endif } Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r7a14f1cc62ad1cb1d7d694f632ff3ddb90ca4717 -r6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 7a14f1cc62ad1cb1d7d694f632ff3ddb90ca4717) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 6788d3f0fe41ee36ac7e9d4bd8e0f407f9fc2c4b) @@ -924,7 +924,9 @@ listTimeInMS = calcTimeSince( badCRCTimeStamps[ badCRCListIdx ] ); if ( ( badCRCListCount >= MAX_COMM_CRC_FAILURES ) && ( listTimeInMS <= MAX_COMM_CRC_FAILURE_WINDOW_MS ) ) { +#ifndef DISABLE_CRC_ERROR activateAlarmNoData( ALARM_ID_COMM_TOO_MANY_BAD_CRCS ); +#endif } }