Index: firmware/App/Controllers/Ejector.c =================================================================== diff -u -r1c6d80a873aa1bd11e28a8955ff38866fc5717f4 -ra0b8983fa00aa8e2e8ec74744978cffaa4011dcd --- firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision 1c6d80a873aa1bd11e28a8955ff38866fc5717f4) +++ firmware/App/Controllers/Ejector.c (.../Ejector.c) (revision a0b8983fa00aa8e2e8ec74744978cffaa4011dcd) @@ -103,37 +103,6 @@ /*********************************************************************//** * @brief - * The resetEjectorFlags function resets the ejector flags to FALSE. - * @details \b Inputs: none - * @details \b Outputs: ejectorHomeRequested, ejectorRetractRequested, - * ejectorExtendRequested, ejectorAbortRequested - * @return none - *************************************************************************/ -static void resetEjectorFlags( void ) -{ - ejectorHomeRequested = FALSE; - ejectorRetractRequested = FALSE; - ejectorExtendRequested = FALSE; - ejectorAbortRequested = FALSE; -} - -/*********************************************************************//** - * @brief - * The setEjectorSpeed function records the requested ejector speed and - * sets the ejector motor speed to that speed. - * @details \b Inputs: none - * @details \b Outputs: currentEjectorSetSpeed - * @param speed Target speed for ejector motor. - * @return none - *************************************************************************/ -static void setEjectorSpeed( F32 speed ) -{ - currentEjectorSetSpeed = speed; - setEjectorMotorSpeed( currentEjectorSetSpeed ); -} - -/*********************************************************************//** - * @brief * The homeEjector function requests an ejector home operation. * @details \b Inputs: currentEjectorState * @details \b Outputs: ejectorHomeRequested @@ -512,6 +481,37 @@ /*********************************************************************//** * @brief + * The resetEjectorFlags function resets the ejector flags to FALSE. + * @details \b Inputs: none + * @details \b Outputs: ejectorHomeRequested, ejectorRetractRequested, + * ejectorExtendRequested, ejectorAbortRequested + * @return none + *************************************************************************/ +static void resetEjectorFlags( void ) +{ + ejectorHomeRequested = FALSE; + ejectorRetractRequested = FALSE; + ejectorExtendRequested = FALSE; + ejectorAbortRequested = FALSE; +} + +/*********************************************************************//** + * @brief + * The setEjectorSpeed function records the requested ejector speed and + * sets the ejector motor speed to that speed. + * @details \b Inputs: none + * @details \b Outputs: currentEjectorSetSpeed + * @param speed Target speed for ejector motor. + * @return none + *************************************************************************/ +static void setEjectorSpeed( F32 speed ) +{ + currentEjectorSetSpeed = speed; + setEjectorMotorSpeed( currentEjectorSetSpeed ); +} + +/*********************************************************************//** + * @brief * The publishEjectorData function constructs and sends the air pump data * broadcast message. * @details \b Message \b Sent: MSG_ID_TD_EJECTOR_DATA Index: firmware/App/Controllers/Valves.c =================================================================== diff -u -r5e92f2578534a1f51e10d181d2566939b890e687 -ra0b8983fa00aa8e2e8ec74744978cffaa4011dcd --- firmware/App/Controllers/Valves.c (.../Valves.c) (revision 5e92f2578534a1f51e10d181d2566939b890e687) +++ firmware/App/Controllers/Valves.c (.../Valves.c) (revision a0b8983fa00aa8e2e8ec74744978cffaa4011dcd) @@ -324,6 +324,31 @@ /*********************************************************************//** * @brief + * The execValvesSelfTest function executes the valves self-test. Calibration + * factors are loaded from non-volatile memory and CRC checked. + * @details \b Inputs: Calibration record stored in non-volatile memory. + * @details \b Outputs: valvesCalibrationRecord + * @return self-test result (pass/fail) + *************************************************************************/ +SELF_TEST_STATUS_T execValvesSelfTest( void ) +{ + BOOL calStatus = TRUE; /* TODO getNVRecord2Driver( GET_CAL_VALVES, (U08*)&valvesCalibrationRecord, sizeof( HD_VALVES_CAL_RECORD_T ), + NUM_OF_CAL_DATA_HD_VALVES, ALARM_ID_NO_ALARM );*/ + + if ( TRUE == calStatus ) + { + valvesSelfTestResult = SELF_TEST_STATUS_PASSED; + } + else + { + valvesSelfTestResult = SELF_TEST_STATUS_FAILED; + } + + return valvesSelfTestResult; +} + +/*********************************************************************//** + * @brief * The handleValvesWait4PostState function handles the Wait for POST state * of the state machine for a given valve. * @details \b Inputs: current operating mode @@ -613,31 +638,6 @@ /*********************************************************************//** * @brief - * The execValvesSelfTest function executes the valves self-test. Calibration - * factors are loaded from non-volatile memory and CRC checked. - * @details \b Inputs: Calibration record stored in non-volatile memory. - * @details \b Outputs: valvesCalibrationRecord - * @return self-test result (pass/fail) - *************************************************************************/ -SELF_TEST_STATUS_T execValvesSelfTest( void ) -{ - BOOL calStatus = TRUE; /* TODO getNVRecord2Driver( GET_CAL_VALVES, (U08*)&valvesCalibrationRecord, sizeof( HD_VALVES_CAL_RECORD_T ), - NUM_OF_CAL_DATA_HD_VALVES, ALARM_ID_NO_ALARM );*/ - - if ( TRUE == calStatus ) - { - valvesSelfTestResult = SELF_TEST_STATUS_PASSED; - } - else - { - valvesSelfTestResult = SELF_TEST_STATUS_FAILED; - } - - return valvesSelfTestResult; -} - -/*********************************************************************//** - * @brief * The checkValveInRange function checks whether the selected valve is in range * and if not it will trigger the provided software fault. * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if given valve is invalid. Index: firmware/App/Drivers/RotaryValve.c =================================================================== diff -u -reef24091316f7c4b5717e72fef7ca06e58fc174a -ra0b8983fa00aa8e2e8ec74744978cffaa4011dcd --- firmware/App/Drivers/RotaryValve.c (.../RotaryValve.c) (revision eef24091316f7c4b5717e72fef7ca06e58fc174a) +++ firmware/App/Drivers/RotaryValve.c (.../RotaryValve.c) (revision a0b8983fa00aa8e2e8ec74744978cffaa4011dcd) @@ -186,36 +186,6 @@ /*********************************************************************//** * @brief - * The getValveStatus function gets the current status for a given valve. - * Status bits: - * 0-motor driver fault - * 1-direction fault - * 2-incorrect encoder sensor fault - * 3..7-reserved - * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if invalid valve given. - * @details \b Inputs: valveStatus[] - * @details \b Outputs: none - * @param valve ID of valve to get status for - * @return Status for the given valve - *************************************************************************/ -static U08 getValveStatus( VALVE_T valve ) -{ - U08 result = 0; - - if ( valve < NUM_OF_VALVES ) - { - result = getU08OverrideValue( &valveStatus[ valve ] ); - } - else - { - SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_VALVES_INVALID_VALVE4, (U32)valve ) - } - - return result; -} - -/*********************************************************************//** - * @brief * The resetValve function resets the valve. * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if invalid valve given. * @details \b Inputs: none @@ -413,7 +383,37 @@ return maxEncoderValue; } +/*********************************************************************//** + * @brief + * The getValveStatus function gets the current status for a given valve. + * Status bits: + * 0-motor driver fault + * 1-direction fault + * 2-incorrect encoder sensor fault + * 3..7-reserved + * @details \b Alarm: ALARM_ID_TD_SOFTWARE_FAULT if invalid valve given. + * @details \b Inputs: valveStatus[] + * @details \b Outputs: none + * @param valve ID of valve to get status for + * @return Status for the given valve + *************************************************************************/ +static U08 getValveStatus( VALVE_T valve ) +{ + U08 result = 0; + if ( valve < NUM_OF_VALVES ) + { + result = getU08OverrideValue( &valveStatus[ valve ] ); + } + else + { + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_TD_SOFTWARE_FAULT, SW_FAULT_ID_VALVES_INVALID_VALVE4, (U32)valve ) + } + + return result; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/