Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -r8cf95991417ca6c7d9ab9a4ba85e28acb1583899 -r7a1358765fb2b530e505ac3ce7ceecfb45f8c6ee --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 8cf95991417ca6c7d9ab9a4ba85e28acb1583899) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 7a1358765fb2b530e505ac3ce7ceecfb45f8c6ee) @@ -34,11 +34,16 @@ #define BLOOD_LEAK_TIMEOUT_MS 500 ///< Blood leak detector timeout for zeroing and self-test (15 ms extended edge detection) #define BLOOD_LEAK_PERSISTENCE ( 5 * MS_PER_SECOND / TASK_PRIORITY_INTERVAL ) ///< Persistence for blood leak detected alarm. #define BLOOD_LEAK_RESET_TX_FIFO 2 ///< Blood leak reset transmit FIFO command. -#define BLOOD_LEAK_START_COMM_CTRL_U_ASCII 21 ///< Blood leak start communication command, ^U in ascii. +#define BLOOD_LEAK_START_COMM_CTRL_U_ASCII 21 ///< Blood leak start communication command, ^U (Ctrl-U) in ascii. #define BLOOD_LEAK_UART_COMM_ACTIVE_LOW 0 ///< Blood leak UART communication active low command. #define BLOOD_LEAK_UART_COMM_ACTIVE_HIGH 1 ///< Blood leak UART communication active high command. #define BLOOD_LEAK_STARTUP_SEQUENCE_LENGTH 5 ///< Blood leak start up sequence array length. +#define BLOOD_LEAK_SET_POINT_START_CHAR 'S' +#define BLOOD_LEAK_CARRIAGE_RETURN_ASCII 13 +#define BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH 7 + + /// Defined states for the blood leak detector state machine. typedef enum BloodLeakStates { @@ -70,14 +75,20 @@ static U32 bloodLeakUARTCmdIndex; ///< Blood leak UART command index. +static U32 bloodLeakSetPointSequenceActualLength = 0; ///< Blood leak set point sequence actual length. + +static U08 bloodLeakSetPointSequence[ BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH ]; ///< Blood leak set point sequence array. + /// Blood leak start up sequence array. static const U08 BLOOD_LEAK_START_UP_SEQUENCE[ BLOOD_LEAK_STARTUP_SEQUENCE_LENGTH ] = { BLOOD_LEAK_RESET_TX_FIFO, BLOOD_LEAK_UART_COMM_ACTIVE_LOW, 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 U32 test = 23; + // ********** private function prototypes ********** static BLOOD_LEAK_STATES_T handleBloodLeakStartupState( void ); @@ -96,7 +107,7 @@ * @details Inputs: none * @details Outputs: bloodLeakState, bloodLeakStatus, bloodLeakSelfTestStatus, * bloodLeakZeroRequested, bloodLeakZeroRequested, bloodLeakSelfTestStartTime, - * bloodLeakUARTCmdIndex + * bloodLeakUARTCmdIndex, bloodLeakSetPointSequence * @return none *************************************************************************/ void initBloodLeak( void ) @@ -111,6 +122,9 @@ bloodLeakZeroStartTime = 0; bloodLeakSelfTestStartTime = 0; bloodLeakUARTCmdIndex = 0; + + // Set the blood leak set pint sequence to 0 to be initialized + memset( bloodLeakSetPointSequence, 0x0, BLOOD_LEAK_SET_POINT_SEQ_MAX_LENGTH); } /*********************************************************************//** Index: firmware/App/HDCommon.h =================================================================== diff -u -r946f42bfd6606dd3d771d9a4a7b50e5678469f62 -r7a1358765fb2b530e505ac3ce7ceecfb45f8c6ee --- firmware/App/HDCommon.h (.../HDCommon.h) (revision 946f42bfd6606dd3d771d9a4a7b50e5678469f62) +++ firmware/App/HDCommon.h (.../HDCommon.h) (revision 7a1358765fb2b530e505ac3ce7ceecfb45f8c6ee) @@ -58,7 +58,7 @@ #define ALWAYS_ALLOW_SYRINGE_PUMP_CMDS 1 // Allow syringe pump commands at any time except when pump is busy #define DISABLE_PRESSURE_CHECKS 1 // Do not error on HD pressure checks #define DISABLE_ARTERIAL_PRESSURE_CHECK 1 // Do not error on arterial pressure out of range - #define DISABLE_VENOUS_PRESSURE_CHECK 1 // Do not error on venous pressure out of range +// #define DISABLE_VENOUS_PRESSURE_CHECK 1 // Do not error on venous pressure out of range // #define DISABLE_UF_ALARMS 1 // Do not error on HD ultrafiltration checks #define DISABLE_DIALYSATE_TEMP_CHECK 1 // Disable dialysate temperature check // #define DISABLE_VALVE_ALARMS 1 // Do not error on HD valve position @@ -77,7 +77,7 @@ #define ALLOW_1_MIN_TREATMENT_DURATION 1 // Allow user to change treatment duration to as low as 1 minute #define DISABLE_SYRINGE_PUMP_ALARMS 1 // Disable some syringe pump alarms that are triggering intermittently // #define NO_PUMP_FLOW_LIMITS 1 // Allow any commanded flow rate for peristaltic pumps - #define DISABLE_BUBBLE_ALARMS 1 // Disable bubble alarms +// #define DISABLE_BUBBLE_ALARMS 1 // Disable bubble alarms #define DISABLE_UI_POST_TEST 1 // Disable the UI POST // #define DISABLE_UI_COMM_TO_ALARM 1 // Disable UI comm timeouts #define DISABLE_WD_AND_SFTY_POST_TESTS 1 // Disable watchdog and safety shutdown POST tests