Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -rbe83f01a4d54cbd0d92b68cb95a15dcbb06a9a51 -r070554b23739bf16ea2bf9528ebabda1ce0ffeb3 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision be83f01a4d54cbd0d92b68cb95a15dcbb06a9a51) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 070554b23739bf16ea2bf9528ebabda1ce0ffeb3) @@ -18,6 +18,7 @@ #include "Common.h" #include "AlarmLamp.h" +#include "BloodFlow.h" #include "OperationModes.h" #include "SystemComm.h" #include "WatchdogMgmt.h" @@ -29,6 +30,10 @@ static BOOL lastUserPress = FALSE; #endif +// ********** private data ********** + +static BOOL uiHasCheckedIn = FALSE; + /************************************************************************* * @brief taskGeneral * The taskGeneral function handles the scheduled General Task interrupt.\n @@ -48,34 +53,45 @@ // manage data received from other sub-systems execSystemCommRx(); - // run operation mode state machine - execOperationModes(); + // prevent most processing until UI has started communicating + if ( TRUE == uiHasCheckedIn ) + { + // control blood pump + execBloodFlowController(); - // manage alarm state - execAlarmMgmt(); + // run operation mode state machine + execOperationModes(); - // control alarm lamp - execAlarmLamp(); + // manage alarm state + execAlarmMgmt(); + // control alarm lamp + execAlarmLamp(); + #ifdef RM46_EVAL_BOARD_TARGET - if ( getUserButtonState() == PIN_SIGNAL_LOW ) - { - if ( lastUserPress == FALSE ) + if ( getUserButtonState() == PIN_SIGNAL_LOW ) { - lastUserPress = TRUE; - setUserLED( FALSE ); - sendOffButtonMsgToUI(TRUE); + if ( lastUserPress == FALSE ) + { + lastUserPress = TRUE; + setUserLED( FALSE ); + sendOffButtonMsgToUI(TRUE); + } } + else + { + lastUserPress = FALSE; + } +#endif + + // manage data to be transmitted to other sub-systems + execSystemCommTx(); } else { - lastUserPress = FALSE; + uiHasCheckedIn = uiCommunicated(); } -#endif - // manage data to be transmitted to other sub-systems - execSystemCommTx(); - // toggle GPIO to indicate general task has executed // gioToggleBit( gioPORTB, 1 ); }