Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r2a6ac80309cb52922f856b3eb4ff2c876b44c0d6 -r0ddfb88172db9b6c0b41b1dc5c0cc3e0296068be --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 2a6ac80309cb52922f856b3eb4ff2c876b44c0d6) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 0ddfb88172db9b6c0b41b1dc5c0cc3e0296068be) @@ -40,6 +40,7 @@ #define BLOOD_LEAK_UART_COMM_ACTIVE_HIGH 1 ///< Blood leak UART communication active high command. #define BLOOD_LEAK_STARTUP_SEQ_LENGTH 5 ///< Blood leak start up sequence array length. +#define BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH 4 #define BLOOD_LEAK_SET_POINT_START_CHAR_ASCII 83 #define BLOOD_LEAK_SET_POINT_START_CHAR_INDEX 0 #define BLOOD_LEAK_CARRIAGE_RETURN_ASCII 13 @@ -87,7 +88,7 @@ BLOOD_LEAK_START_COMM_CTRL_U_ASCII, BLOOD_LEAK_UART_COMM_ACTIVE_HIGH, BLOOD_LEAK_UART_COMM_ACTIVE_LOW }; -static const U32 REMOVE_LATER_SET_POINT = 20; // TODO remove this later +static const U32 REMOVE_LATER_SET_POINT = 38; // TODO remove this later static U32 test = 38; @@ -247,7 +248,7 @@ U32 bloodLeakSetPoint = (U32)getFPGABloodLeakDetectSetPoint(); - if ( REMOVE_LATER_SET_POINT == bloodLeakSetPoint ) + if ( REMOVE_LATER_SET_POINT != bloodLeakSetPoint ) { prepareSetPointSeq(); @@ -280,7 +281,7 @@ { // The active high index is the length - 2 they are the last two elements - 1 since the // index starts from 0 - U32 activeHighIndex = bloodLeakSetPointSeqLength - 2 - 1; + U32 activeHighIndex = bloodLeakSetPointSeqLength - 2; // Check if the current index towards the end of the buffer which are 1 and 0 if( activeHighIndex == bloodLeakUARTCmdIndex ) { @@ -506,11 +507,11 @@ // Set the local variables. Create a local char buffer with the maximum possible length // The set point can be maximum 3 digits and when it is converted to string, the null character // is the extra character at the end of the buffer so it maximum length is 4 bytes. - U32 digitCount = 0; - U32 setPoint = test; // TODO make the origin of the number right - U32 setPointMaxLength = 4; - U32 bufferIndex = BLOOD_LEAK_SET_POINT_START_CHAR_INDEX; - char tempCharBuffer[ setPointMaxLength ]; + U32 digitCount = 0; + U32 setPoint = test; // TODO make the origin of the number right + U32 bufferIndex = BLOOD_LEAK_SET_POINT_START_CHAR_INDEX; + char tempCharBuffer[ BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH ]; + memset( tempCharBuffer, 0x0, BLOOD_LEAK_SET_POINT_MAX_CHAR_LENGTH ); while ( setPoint != 0 ) { @@ -521,6 +522,9 @@ digitCount++; } + // + setPoint = test; + // Convert the set point number to the equivalent ASCII number with the unsigned integer data type sprintf( tempCharBuffer, "%u", setPoint ); @@ -547,7 +551,7 @@ bloodLeakSetPointSequence[ bufferIndex ] = BLOOD_LEAK_UART_COMM_ACTIVE_LOW; // Update the sequence length for writing to the sensor - bloodLeakSetPointSeqLength = bufferIndex; + bloodLeakSetPointSeqLength = bufferIndex + 1; } /*********************************************************************//** Index: firmware/App/Controllers/Fans.c =================================================================== diff -u -r2a6ac80309cb52922f856b3eb4ff2c876b44c0d6 -r0ddfb88172db9b6c0b41b1dc5c0cc3e0296068be --- firmware/App/Controllers/Fans.c (.../Fans.c) (revision 2a6ac80309cb52922f856b3eb4ff2c876b44c0d6) +++ firmware/App/Controllers/Fans.c (.../Fans.c) (revision 0ddfb88172db9b6c0b41b1dc5c0cc3e0296068be) @@ -106,7 +106,7 @@ * @details Inputs: none * @details Outputs: fansExecState, fansMonitorCounter, fansControlCounter, * fansPublishCounter, isPOSTComplete, hasAlarmBeenRaised, fansStatus, - * rpmAlarmStartTimer + * rpmAlarmStartTime, rpmAlarmStartTimeOffset * @return none *************************************************************************/ void initFans( void ) Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r2a6ac80309cb52922f856b3eb4ff2c876b44c0d6 -r0ddfb88172db9b6c0b41b1dc5c0cc3e0296068be --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 2a6ac80309cb52922f856b3eb4ff2c876b44c0d6) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 0ddfb88172db9b6c0b41b1dc5c0cc3e0296068be) @@ -1606,7 +1606,7 @@ handleTestSyringePumpForceSensorCalibrateRequest( message ); break; - case MSG_ID_HD_FAN_RPM_ALARM_START_TIME_OVERRIDE: + case MSG_ID_HD_FAN_RPM_ALARM_START_TIME_OFFSET_OVERRIDE: handleTestFansRPMAlarmStartTimeOffsetOverrideRequest( message ); break;