Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r03843cd217e3beaa24f7ff17a892a44d05b43734 -r19a056fb3d8cc1ff53f65989a1a23924113f74b3 --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 03843cd217e3beaa24f7ff17a892a44d05b43734) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 19a056fb3d8cc1ff53f65989a1a23924113f74b3) @@ -354,21 +354,21 @@ else { // TODO remove this is temporary code - U16 bld = getFPGABloodLeakDetectSetPoint(); + /*U16 bld = getFPGABloodLeakDetectSetPoint(); if ( bld == bloodLeakCalRecord.setPoint ) { U32 timeout = calcTimeSince(tempRemoveThis); state = BLOOD_LEAK_INIT_STATE; - } + }*/ // TODo Remove this is temporary code - /*if ( ++bloodLeakWait2ReadSetPointCounter > BLOOD_LEAK_WAIT_2_READ_SET_POINT ) + if ( ++bloodLeakWait2ReadSetPointCounter > BLOOD_LEAK_WAIT_2_READ_SET_POINT ) { bloodLeakWait2ReadSetPointCounter = 0; bloodLeakUARTCmdIndex = 0; // Done with writing the set point state = BLOOD_LEAK_CHECK_SET_POINT_STATE; - }*/ + } } return state; @@ -584,22 +584,12 @@ char tempCharBuffer[ BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH ]; memset( tempCharBuffer, 0x0, BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH ); - while ( setPoint != 0 ) - { - // Calculate the number of digits of the set point - // Keep dividing the set point to 10 and count the digits until the set point - // is 0. This value is an unsigned integer. - setPoint = setPoint / 10; - digitCount++; - } - - // Set point was divided up for find out the number of digits - // so it is reinstated again for the rest of the calculations - setPoint = bloodLeakCalRecord.setPoint; - // Convert the set point number to the equivalent ASCII number with the unsigned integer data type sprintf( tempCharBuffer, "%u", setPoint ); + // Calculate the length of the character buffer. strlen does not consider the null character. + digitCount = strlen( tempCharBuffer ); + // Set the first item to the ASCII character of S. The format to set the set point is // SXXXCR10. It starts with S followed by the characters up to 3 digits, carriage return and a 1 and a 0 to write to the buffer. bloodLeakSetPointSequence[ bufferIndex ] = BLOOD_LEAK_SET_POINT_START_CHAR_ASCII; Index: firmware/App/Controllers/DGInterface.h =================================================================== diff -u -r62cbfbbd0d1baa7b1f383510b7864921e2dfd054 -r19a056fb3d8cc1ff53f65989a1a23924113f74b3 --- firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 62cbfbbd0d1baa7b1f383510b7864921e2dfd054) +++ firmware/App/Controllers/DGInterface.h (.../DGInterface.h) (revision 19a056fb3d8cc1ff53f65989a1a23924113f74b3) @@ -123,11 +123,11 @@ /// Dialysate heating parameters typedef struct { - F32 trimmerTargetTemperature; - U32 timeReservoirCycleMS; - F32 timeReservoirFillMS; - U32 timeReservoirWait2SwitchMS; - F32 dialysateFlowLPM; + F32 trimmerTargetTemperature; ///< Trimmer target temperature + U32 timeReservoirCycleMS; ///< Reservoir cycle time in milliseconds + F32 timeReservoirFillMS; ///< Reservoir fill time in milliseconds + U32 timeReservoirWait2SwitchMS; ///< Reservoir wait to switch time in milliseconds + F32 dialysateFlowLPM; ///< Dialysate flow in L/min } DG_CMD_DIALYSATE_HEATING_PARAMS_T; // ********** public function prototypes **********