Index: firmware/App/Controllers/Ejector.c =================================================================== diff -u -raa6d45143096dfab776ce2ed7c775cfe2dd6db18 -r959f16a2530e68b517cbb5c12c430d5aef4c5f9d --- firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision aa6d45143096dfab776ce2ed7c775cfe2dd6db18) +++ firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision 959f16a2530e68b517cbb5c12c430d5aef4c5f9d) @@ -73,9 +73,9 @@ /*********************************************************************//** * @brief - * The initEjector function initializes the air pump driver. + * The initEjector function initializes the ejector driver. * @details \b Inputs: none - * @details \b Outputs: Air pump driver unit initialized + * @details \b Outputs: Ejector driver unit initialized * @return none *************************************************************************/ void initEjector(void) @@ -365,10 +365,10 @@ * @brief * The publishEjectorData function constructs and sends the air pump data * broadcast message. - * @details \b Message \b Sent: MSG_ID_TD_AIR_PUMP_DATA - * @details \b Inputs: airPumpDataPublicationTimerCounter, currentEjectorState, + * @details \b Message \b Sent: MSG_ID_TD_EJECTOR_DATA + * @details \b Inputs: ejectorDataPublicationTimerCounter, currentEjectorState, * currentEjectorSetSpeed - * @details \b Outputs: airPumpDataPublicationTimerCounter + * @details \b Outputs: ejectorDataPublicationTimerCounter * @return none *************************************************************************/ static void publishEjectorData( void ) @@ -408,6 +408,16 @@ return result; } +/*********************************************************************//** + * @brief + * The testEjectorCommand function handles a test request to execute an + * ejector operation. + * @details \b Inputs: none + * @details \b Outputs: requested operation initiated + * @param message Ejector operation request message from Dialin which includes + * the requested ejector operation ID + * @return TRUE if request is successful, FALSE if not + *************************************************************************/ BOOL testEjectorCommand( MESSAGE_T *message ) { BOOL result = FALSE; Index: firmware/App/Controllers/Ejector.h =================================================================== diff -u -raa6d45143096dfab776ce2ed7c775cfe2dd6db18 -r959f16a2530e68b517cbb5c12c430d5aef4c5f9d --- firmware/App/Controllers/Ejector.h (.../Ejector.h) (revision aa6d45143096dfab776ce2ed7c775cfe2dd6db18) +++ firmware/App/Controllers/Ejector.h (.../Ejector.h) (revision 959f16a2530e68b517cbb5c12c430d5aef4c5f9d) @@ -25,7 +25,7 @@ /** * @defgroup Ejector Ejector - * @brief Air Pump controller unit. Provides higher level control of the air pump. + * @brief Ejector controller unit. Provides higher level control of the ejector. * * @addtogroup Ejector * @{ Index: firmware/App/Drivers/EjectorMotor.c =================================================================== diff -u -raa6d45143096dfab776ce2ed7c775cfe2dd6db18 -r959f16a2530e68b517cbb5c12c430d5aef4c5f9d --- firmware/App/Drivers/EjectorMotor.c (.../EjectorMotor.c) (revision aa6d45143096dfab776ce2ed7c775cfe2dd6db18) +++ firmware/App/Drivers/EjectorMotor.c (.../EjectorMotor.c) (revision 959f16a2530e68b517cbb5c12c430d5aef4c5f9d) @@ -69,7 +69,7 @@ // ********** private data ********** -static F32 currentEjectorMotorSetSpeed; ///< Current air pump motor state: 0=off, 1..255=power level. +static F32 currentEjectorMotorSetSpeed; ///< Current ejector motor set speed (in RPM). static U32 ejectorMotorSetToggleTime; ///< Time (in uSec) between microstep toggles. static U32 ejectorMotorRampUpToggleTime; ///< Current ramp time (in uSec) between microstep toggles. static U32 ejectorMotorRampTimerCtr; ///< Used to track ramp up time. @@ -102,8 +102,9 @@ * @brief * The setEjectorMotorSpeed function sets the ejector motor to the given * set speed and direction. - * @details \b Inputs: none - * @details \b Outputs: + * @details \b Inputs: currentEjectorMotorSetSpeed + * @details \b Outputs: currentEjectorMotorSetSpeed, ejectorMotorSetToggleTime + * ejectorMotorRampUpToggleTime, ejectorMotorRampUpInProgress * @param rpm Speed (rpm) to set the ejector motor to (negative value indicates reverse direction) * @return TRUE if ejector motor speed set successfully, FALSE if not. *************************************************************************/ Index: firmware/App/Services/DDInterface.c =================================================================== diff -u -rdb8ff28e816a37e033e36b76ab5949be78114125 -r959f16a2530e68b517cbb5c12c430d5aef4c5f9d --- firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision db8ff28e816a37e033e36b76ab5949be78114125) +++ firmware/App/Services/DDInterface.c (.../DDInterface.c) (revision 959f16a2530e68b517cbb5c12c430d5aef4c5f9d) @@ -36,7 +36,7 @@ // ********** private data ********** -// DG status +// DD status static DD_OP_MODE_T ddCurrentOpMode; ///< Current DD operation mode. static U32 ddSubMode; ///< Current state (sub-mode) of current DD operation mode. static F32 dialysatePressure; ///< Current dialysate pressure reported by DD. @@ -48,7 +48,7 @@ static DIALYSATE_DELIVERY_REQ_PAYLOAD_T dialysateDeliveryCmdSet; ///< Set of dialysate delivery parameters to send to the DD during treatment. -// DG command response +// DD command response static DD_CMD_RESPONSE_T ddCmdResp[ NUM_OF_DD_COMMANDS ]; ///< Keep the latest DD command response for each command. // ********** private function prototypes ********** @@ -111,26 +111,26 @@ /**********************************************************************//** * @brief - * The checkDGDataFreshness function checks the freshness of data coming from + * The checkDDDataFreshness function checks the freshness of data coming from * the DD sub-system. * @details \b Alarm: Given alarm is triggered if DD is communicating but has * not published new data for too long. * @details \b Inputs: DD communicating flag * @details \b Outputs: none * @param alarm ID of alarm to check - * @param dgFreshDataFlag Pointer to flag indicating whether new data has been + * @param ddFreshDataFlag Pointer to flag indicating whether new data has been * received since last time this function has seen it. * @return None *************************************************************************/ -static void checkDGDataFreshness( ALARM_ID_T alarmID, BOOL *dgFreshDataFlag ) +static void checkDDDataFreshness( ALARM_ID_T alarmID, BOOL *ddFreshDataFlag ) { - if ( TRUE == *dgFreshDataFlag ) + if ( TRUE == *ddFreshDataFlag ) { - *dgFreshDataFlag = FALSE; + *ddFreshDataFlag = FALSE; checkPersistentAlarm( alarmID, FALSE, 0.0, 0.0 ); } else - { // Alarm if not receiving DG fresh data message in timely manner + { // Alarm if not receiving DD fresh data message in timely manner if ( TRUE == isDDCommunicating() ) { checkPersistentAlarm( alarmID, TRUE, 0.0, 0.0 ); @@ -144,7 +144,7 @@ /*********************************************************************//** * @brief - * The execDGInterfaceMonitor function executes the DD Interface monitoring + * The execDDInterfaceMonitor function executes the DD Interface monitoring * function. Ensures DD is sending fresh data in a timely manner. * @details \b Inputs: ddOpModeDataFreshFlag * @details \b Outputs: ddOpModeDataFreshFlag @@ -181,7 +181,7 @@ /*********************************************************************//** * @brief - * The getDGSubMode function gets the latest reported DD operating sub-mode. + * The getDDSubMode function gets the latest reported DD operating sub-mode. * @details \b Inputs: ddSubMode * @details \b Outputs: none * @return Latest reported DD operating sub-mode. @@ -396,38 +396,6 @@ sendMessage( MSG_ID_DD_GEN_DIALYSATE_REQUEST_DATA, COMM_BUFFER_OUT_CAN_TD_2_DD, (U08*)(&dialysateDeliveryCmdSet), sizeof( DIALYSATE_DELIVERY_REQ_PAYLOAD_T ) ); } -/**********************************************************************//** - * @brief - * The checkDDDataFreshness function checks to verify that needed data from - * the DD sub-system is coming regularly to keep the data fresh. - * @details Alarm: Data freshness alarm triggered if fresh data not received - * within 2 seconds of last data broadcast. - * @details Inputs: none - * @details Outputs: ddFreshDataFlag set to FALSE - * @param alarm ID of alarm to check - * @param ddFreshDataFlag flag indicating whether data is fresh - * @return None - *************************************************************************/ -static void checkDDDataFreshness( ALARM_ID_T alarmID, BOOL *ddFreshDataFlag ) -{ - if ( TRUE == *ddFreshDataFlag ) - { - *ddFreshDataFlag = FALSE; - checkPersistentAlarm( alarmID, FALSE, 0.0, 0.0 ); - } - else - { // Alarm if not receiving DD fresh data message in timely manner - if ( TRUE == isDDCommunicating() ) - { - checkPersistentAlarm( alarmID, TRUE, 0.0, 0.0 ); - } - else - { - checkPersistentAlarm( alarmID, FALSE, 0.0, 0.0 ); - } - } -} - /*********************************************************************//** * @brief * The handleDDCommandResponse function processes the latest DD command response. @@ -514,8 +482,8 @@ // if ( TRUE == ddStarted ) // { -// if ( ( DG_MODE_FAUL != ddCurrentOpMode ) && ( DG_MODE_GEND != ddCurrentOpMode ) && -// ( DG_MODE_FILL != ddCurrentOpMode ) && ( DG_MODE_DRAI != ddCurrentOpMode ) ) +// if ( ( DD_MODE_FAUL != ddCurrentOpMode ) && ( DD_MODE_GEND != ddCurrentOpMode ) && +// ( DD_MODE_FILL != ddCurrentOpMode ) && ( DD_MODE_DRAI != ddCurrentOpMode ) ) // { // activateAlarmNoData( ALARM_ID_TD_DD_RESTARTED_FAULT ); // ddStarted = FALSE; // do not want to re-trigger alarm after alarm is cleared