Index: firmware/App/Modes/Dialysis.c =================================================================== diff -u -re22cea17af706bcdaed705302094b096818147b0 -r88ee6f3dce69a3dadb012bb8a39c3fd167ba0afd --- firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision e22cea17af706bcdaed705302094b096818147b0) +++ firmware/App/Modes/Dialysis.c (.../Dialysis.c) (revision 88ee6f3dce69a3dadb012bb8a39c3fd167ba0afd) @@ -79,7 +79,7 @@ static F32 totalSalineVolumeDelivered; ///< Volume (mL) in total of saline delivered so far (cumulative for all boluses including current one). static F32 bolusSalineVolumeDelivered; ///< Volume (mL) of current bolus delivered so far. static F32 bolusSalineVolumeDelivered_Safety; ///< Volume (mL) of current bolus delivered so far according to safety monitor. -static U32 bolusSalineMotorCount; ///< Blood pump motor rev count during saline bolus to calculate saline bolus volume independently for safety. +static S32 bolusSalineMotorCount; ///< Blood pump motor rev count during saline bolus to calculate saline bolus volume independently for safety. static U32 bolusSalineLastMotorCount; ///< Last blood pump count from last saline bolus volume update. static U32 bolusSalineLastVolumeTimeStamp; ///< Time stamp for last saline volume update. @@ -884,7 +884,7 @@ bolusSalineLastVolumeTimeStamp = getMSTimerCount(); bolusSalineVolumeDelivered += volSinceLastUpdateMl; totalSalineVolumeDelivered += volSinceLastUpdateMl; - bolusSalineMotorCount = u32DiffWithWrap( bolusSalineLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; + bolusSalineMotorCount = u32BiDiffWithWrap( bolusSalineLastMotorCount, getBloodPumpMotorCount() ) / BP_HALL_EDGE_COUNTS_PER_REV; bolusSalineVolumeDelivered_Safety = ( (F32)bolusSalineMotorCount * VOLUME_PER_BP_MOTOR_REV_ML ); // TODO - include upstream pressure compensation to this calc (from PBA). #ifndef DISABLE_SALINE_BOLUS_CHECKS Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r88ee6f3dce69a3dadb012bb8a39c3fd167ba0afd --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 88ee6f3dce69a3dadb012bb8a39c3fd167ba0afd) @@ -254,12 +254,13 @@ if ( ( flags & SCI_FE_INT ) != 0 ) { sci2FrameErrorCnt++; - clearSCI2CommErrors(); + clearSCI2CommErrors(); +#ifndef DEBUG_ENABLED if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_FRAME_ERROR ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_FRAME_ERROR ) } -#ifdef DEBUG_ENABLED +#else sprintf( debugStr, "FPGA UART FR err:%5d \n", sci2FrameErrorCnt ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); sendDebugDataToUI( (U08*)debugStr ); @@ -268,12 +269,13 @@ if ( ( flags & SCI_OE_INT ) != 0 ) { sci2OverrunErrorCnt++; - clearSCI2CommErrors(); + clearSCI2CommErrors(); +#ifndef DEBUG_ENABLED if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_UART_OVERRUN ) ) { SET_ALARM_WITH_1_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_UART_OVERRUN_ERROR ) } -#ifdef DEBUG_ENABLED +#else sprintf( debugStr, "FPGA UART OR err:%5d \n", sci2OverrunErrorCnt ); sendDebugData( (U08*)debugStr, strlen(debugStr) ); sendDebugDataToUI( (U08*)debugStr );