Index: firmware/App/Services/ROInterface.c =================================================================== diff -u -rff90c5d3a21b9b4eecc4f85a4cfeb15bff28d371 -r4b09605126f35b80406e95d079f3822c51a3ba25 --- firmware/App/Services/ROInterface.c (.../ROInterface.c) (revision ff90c5d3a21b9b4eecc4f85a4cfeb15bff28d371) +++ firmware/App/Services/ROInterface.c (.../ROInterface.c) (revision 4b09605126f35b80406e95d079f3822c51a3ba25) @@ -33,59 +33,59 @@ // ********** private definitions ********** -#define RO_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< RO data freshness timeout (in ms). -#define MAX_RO_FLOW_RATE ( 700.0F ) ///< Max RO pump flow rate +#define FP_DATA_FRESHNESS_TIMEOUT_MS ( 3 * MS_PER_SECOND ) ///< FP data freshness timeout (in ms). +#define MAX_FP_FLOW_RATE ( 700.0F ) ///< Max FP pump flow rate // ********** private data ********** -static RO_OP_MODE_T roCurrentOpMode; ///< Current TD operation mode. -static U32 roSubMode; ///< Current state (sub-mode) of current TD operation mode. -static F32 roFlowRate; ///< RO flow rate +static FP_OP_MODE_T fpCurrentOpMode; ///< Current TD operation mode. +static U32 fpSubMode; ///< Current state (sub-mode) of current TD operation mode. +static F32 fpFlowRate; ///< FP flow rate -static BOOL roOpModeDataFreshFlag = FALSE; ///< Flag to signal/process fresh RO op mode data +static BOOL fpOpModeDataFreshFlag = FALSE; ///< Flag to signal/process fresh FP op mode data // ********** private function prototypes ********** -static void checkRODataFreshness( ALARM_ID_T alarmID, BOOL *roFreshDataFlag ); +static void checkFPDataFreshness( ALARM_ID_T alarmID, BOOL *fpFreshDataFlag ); /*********************************************************************//** * @brief - * The initROInterface function initializes the RO Interface unit. + * The initFPInterface function initializes the FP Interface unit. * @details \b Inputs: none - * @details \b Outputs: RO Interface unit initialized. + * @details \b Outputs: FP Interface unit initialized. * @return none *************************************************************************/ -void initROInterface( void ) +void initFPInterface( void ) { // Initialize unit variables - roCurrentOpMode = RO_MODE_INIT; - roSubMode = 0; - roFlowRate = MAX_RO_FLOW_RATE; + fpCurrentOpMode = FP_MODE_INIT; + fpSubMode = 0; + fpFlowRate = MAX_FP_FLOW_RATE; } /**********************************************************************//** * @brief - * The checkRODataFreshness function checks the freshness of data coming from - * the RO sub-system. - * @details \b Alarm: Given alarm is triggered if RO is communicating but has + * The checkFPDataFreshness function checks the freshness of data coming from + * the FP sub-system. + * @details \b Alarm: Given alarm is triggered if FP is communicating but has * not published new data for too long. - * @details \b Inputs: RO communicating flag + * @details \b Inputs: FP communicating flag * @details \b Outputs: none * @param alarm ID of alarm to check - * @param roFreshDataFlag Pointer to flag indicating whether new data has been + * @param fpFreshDataFlag Pointer to flag indicating whether new data has been * received since last time this function has seen it. * @return None *************************************************************************/ -static void checkRODataFreshness( ALARM_ID_T alarmID, BOOL *roFreshDataFlag ) +static void checkFPDataFreshness( ALARM_ID_T alarmID, BOOL *fpFreshDataFlag ) { - if ( TRUE == *roFreshDataFlag ) + if ( TRUE == *fpFreshDataFlag ) { - *roFreshDataFlag = FALSE; + *fpFreshDataFlag = FALSE; checkPersistentAlarm( alarmID, FALSE, 0.0, 0.0 ); } else - { // Alarm if not receiving RO fresh data message in timely manner - if ( TRUE == isROCommunicating() ) + { // Alarm if not receiving FP fresh data message in timely manner + if ( TRUE == isFPCommunicating() ) { checkPersistentAlarm( alarmID, TRUE, 0.0, 0.0 ); } @@ -98,44 +98,44 @@ /*********************************************************************//** * @brief - * The execROInterfaceMonitor function executes the RO Interface monitoring - * function. Ensures RO is sending fresh data in a timely manner. + * The execFPInterfaceMonitor function executes the FP Interface monitoring + * function. Ensures FP is sending fresh data in a timely manner. * @details \b Inputs: none * @details \b Outputs: none * @return none *************************************************************************/ -void execROInterfaceMonitor( void ) +void execFPInterfaceMonitor( void ) { } /*********************************************************************//** * @brief - * The cmdROStartStop function sends a start/stop command to RO for mode + * The cmdFPStartStop function sends a start/stop command to FP for mode * transition and generate water with commanded flow rate. * @details Inputs: none * @details Outputs: start/stop command along with flow rate if applicable. - * @param startStop To start/stop the RO delivery. + * @param startStop To start/stop the FP delivery. * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL cmdROStartStop( BOOL startStop, RO_CMD_ID cmdMode) +BOOL cmdFPStartStop( BOOL startStop, RO_CMD_ID cmdMode) { - RO_WATER_REQ_PAYLOAD_T roStartRequest; + FP_WATER_REQ_PAYLOAD_T fpStartRequest; BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; - // Populate RO start message - roStartRequest.cmdID = (U32)cmdMode; - roStartRequest.start = startStop; - roStartRequest.roRate = getROFlowRate(); + // Populate FP start message + fpStartRequest.cmdID = (U32)cmdMode; + fpStartRequest.start = startStop; + fpStartRequest.roRate = getFPFlowRate(); // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DD_FP_START_STOP_CMD_REQUEST; - msg.hdr.payloadLen = sizeof( RO_WATER_REQ_PAYLOAD_T ); + msg.hdr.payloadLen = sizeof( FP_WATER_REQ_PAYLOAD_T ); - memcpy( payloadPtr, &roStartRequest, sizeof( RO_WATER_REQ_PAYLOAD_T ) ); + memcpy( payloadPtr, &fpStartRequest, sizeof( FP_WATER_REQ_PAYLOAD_T ) ); // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_DD_2_RO, ACK_REQUIRED ); @@ -145,78 +145,78 @@ /*********************************************************************//** * @brief - * The setROFlowRate function sets the RO pump flow rate to deliver purified + * The setFPFlowRate function sets the FP pump flow rate to deliver purified * water. * @details \b Inputs: none - * @details \b Outputs: roFlowRate + * @details \b Outputs: fpFlowRate * @return none. *************************************************************************/ -void setROFlowRate( F32 roFlow ) +void setFPFlowRate( F32 fpFlow ) { - roFlowRate = roFlow; + fpFlowRate = fpFlow; } /*********************************************************************//** * @brief - * The getROFlowRate function gets the RO flow rate. + * The getFPFlowRate function gets the FP flow rate. * @details \b Inputs: Ro flow rate * @details \b Outputs: none - * @return latest RO pump flow rate. + * @return latest FP pump flow rate. *************************************************************************/ -F32 getROFlowRate( void ) +F32 getFPFlowRate( void ) { - return roFlowRate; + return fpFlowRate; } /*********************************************************************//** * @brief - * The getROOpMode function gets the current latest reported RO operating mode. - * @details \b Inputs: roCurrentOpMode + * The getFPOpMode function gets the current latest reported FP operating mode. + * @details \b Inputs: fpCurrentOpMode * @details \b Outputs: none - * @return Latest reported RO operating mode. + * @return Latest reported FP operating mode. *************************************************************************/ -RO_OP_MODE_T getROOpMode( void ) +FP_OP_MODE_T getFPOpMode( void ) { - return roCurrentOpMode; + return fpCurrentOpMode; } /*********************************************************************//** * @brief - * The getROSubMode function gets the latest reported RO operating sub-mode. - * @details \b Inputs: roSubMode + * The getFPSubMode function gets the latest reported FP operating sub-mode. + * @details \b Inputs: fpSubMode * @details \b Outputs: none - * @return Latest reported RO operating sub-mode. + * @return Latest reported FP operating sub-mode. *************************************************************************/ -U32 getROSubMode( void ) +U32 getFPSubMode( void ) { - return roSubMode; + return fpSubMode; } /*********************************************************************//** * @brief - * The setROOpMode function sets the latest RO operating mode reported by - * the RO (called by RO published message handler). - * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if reported RO mode is invalid. + * The setFPOpMode function sets the latest FP operating mode reported by + * the FP (called by FP published message handler). + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if reported FP mode is invalid. * @details \b Inputs: none - * @details \b Outputs: roCurrentOpMode, roSubMode, roOpModeDataFreshFlag - * @param opMode The operating mode reported by RO - * @param subMode The sub-mode of operating mode reported by RO + * @details \b Outputs: fpCurrentOpMode, fpSubMode, fpOpModeDataFreshFlag + * @param opMode The operating mode reported by FP + * @param subMode The sub-mode of operating mode reported by FP * @return none *************************************************************************/ -void setROOpMode( U32 opMode, U32 subMode ) +void setFPOpMode( U32 opMode, U32 subMode ) { - if ( opMode < NUM_OF_RO_MODES ) + if ( opMode < NUM_OF_FP_MODES ) { - // update RO op mode and sub-mode - roCurrentOpMode = (RO_OP_MODE_T)opMode; - roSubMode = subMode; + // update FP op mode and sub-mode + fpCurrentOpMode = (FP_OP_MODE_T)opMode; + fpSubMode = subMode; } else { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_RO_OPERATING_MODE, opMode ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_INVALID_FP_OPERATING_MODE, opMode ); } - roOpModeDataFreshFlag = TRUE; + fpOpModeDataFreshFlag = TRUE; }