Index: firmware/App/Drivers/PAL.c =================================================================== diff -u -r6ce9326aeabf018e9c531163359f7283f9d60ae9 -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Drivers/PAL.c (.../PAL.c) (revision 6ce9326aeabf018e9c531163359f7283f9d60ae9) +++ firmware/App/Drivers/PAL.c (.../PAL.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -14,7 +14,7 @@ * @date (original) 07-Aug-2024 * ***************************************************************************/ - +#include "mibspi.h" #include "reg_system.h" #include "reg_crc.h" @@ -25,13 +25,17 @@ * @{ */ -// ********** private definitions ********** +// ********** private definitions ********** +#define SAFETY_SPI1_PORT_MASK 0x00000010 ///< Safety shutdown GPIO port mask (CS[4] - re-purposed as output GPIO). +#define SET_SAFETY_SHUTDOWN() {mibspiREG1->PC3 |= SAFETY_SPI1_PORT_MASK;} ///< Set safety shutdown GPIO macro. +#define CLR_SAFETY_SHUTDOWN() {mibspiREG1->PC3 &= ~SAFETY_SPI1_PORT_MASK;} ///< Clear safety shutdown GPIO macro. + /*********************************************************************//** * @brief * The setSystemREG1_SYSECR function sets the SYSECR register to a given value. - * @details Inputs: none - * @details Outputs: SYSECR register set to given value + * @details \b Inputs: none + * @details \b Outputs: SYSECR register set to given value * @return none *************************************************************************/ void setSystemREG1_SYSECR( U32 regval ) @@ -42,8 +46,8 @@ /*********************************************************************//** * @brief * The getSystemREG1_SYSECR function gets the current value of the SYSECR register. - * @details Inputs: SYSECR register - * @details Outputs: none + * @details \b Inputs: SYSECR register + * @details \b Outputs: none * @return Value of the SYSECR register *************************************************************************/ U32 getSystemREG1_SYSECR( void ) @@ -55,8 +59,8 @@ * @brief * The setCrcREG_PSA_SIGREGL1 function sets the CRC PSA_SIGREGL1 register * to a given value. - * @details Inputs: none - * @details Outputs: PSA_SIGREGL1 register set to given value + * @details \b Inputs: none + * @details \b Outputs: PSA_SIGREGL1 register set to given value * @return none *************************************************************************/ void setCrcREG_PSA_SIGREGL1( U32 regval ) @@ -68,13 +72,37 @@ * @brief * The getCrcREG_PSA_SIGREGL1 function gets the current value of the CRC * PSA_SIGREGL1 register. - * @details Inputs: PSA_SIGREGL1 register - * @details Outputs: none + * @details \b Inputs: PSA_SIGREGL1 register + * @details \b Outputs: none * @return Value of the PSA_SIGREGL1 register *************************************************************************/ U32 getCrcREG_PSA_SIGREGL1( void ) { return crcREG->PSA_SIGREGL1; } +/*********************************************************************//** + * @brief + * The set_saftey_shutdown function sets the GPIO to disable 24v supply. + * @details \b Inputs: none + * @details \b Outputs: mibspiREG1->PC3 + * @return Value none + *************************************************************************/ +void set_safety_shutdown( void ) +{ + SET_SAFETY_SHUTDOWN(); +} + +/*********************************************************************//** + * @brief + * The clear_saftety_shutdown function clears the GPIO to enable 24v supply. + * @details \b Inputs: none + * @details \b Outputs: mibspiREG1->PC3 + * @return Value none + *************************************************************************/ +void clear_saftety_shutdown( void ) +{ + CLR_SAFETY_SHUTDOWN(); +} + /**@}*/ Index: firmware/App/Drivers/PAL.h =================================================================== diff -u -r6ce9326aeabf018e9c531163359f7283f9d60ae9 -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Drivers/PAL.h (.../PAL.h) (revision 6ce9326aeabf018e9c531163359f7283f9d60ae9) +++ firmware/App/Drivers/PAL.h (.../PAL.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -37,6 +37,8 @@ void setCrcREG_PSA_SIGREGL1( U32 regval ); U32 getCrcREG_PSA_SIGREGL1( void ); +void clear_saftety_shutdown( void ); +void set_safety_shutdown( void ); /**@}*/ #endif Index: firmware/App/Drivers/SafetyShutdown.c =================================================================== diff -u -r6ce9326aeabf018e9c531163359f7283f9d60ae9 -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Drivers/SafetyShutdown.c (.../SafetyShutdown.c) (revision 6ce9326aeabf018e9c531163359f7283f9d60ae9) +++ firmware/App/Drivers/SafetyShutdown.c (.../SafetyShutdown.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -21,6 +21,7 @@ #include "Messaging.h" #include "SafetyShutdown.h" #include "Timers.h" +#include "PAL.h" /** * @addtogroup SafetyShutdown @@ -29,10 +30,6 @@ // ********** private definitions ********** -#define SAFETY_SPI1_PORT_MASK 0x00000010 ///< Safety shutdown GPIO port mask (CS[4] - re-purposed as output GPIO). -#define SET_SAFETY_SHUTDOWN() {mibspiREG1->PC3 |= SAFETY_SPI1_PORT_MASK;} ///< Set safety shutdown GPIO macro. -#define CLR_SAFETY_SHUTDOWN() {mibspiREG1->PC3 &= ~SAFETY_SPI1_PORT_MASK;} ///< Clear safety shutdown GPIO macro. - #define SAFETY_SHUTDOWN_POST_TIMEOUT_MS 500 ///< Safety shutdown POST test timeout (in ms). #define SAFETY_SHUTDOWN_RECOVERY_TIME_MS 500 ///< After safety shutdown POST test, wait this long (in ms) to recover before moving on. @@ -60,9 +57,11 @@ /*********************************************************************//** * @brief - * The initSafetyShutdown function initializes the safety shutdown module. - * @details Inputs: none - * @details Outputs: safetyShutdownActivated, safetyShutdownOverrideResetState, + * The initSafetyShutdown function initializes the safety shutdown module. + * The safety shutdown module is to cut down the 24v DC supply to majority of actuators + * when system detects critical faulty conditions. + * @details \b Inputs: none + * @details \b Outputs: safetyShutdownActivated, safetyShutdownOverrideResetState, * safetyShutdownSelfTestState, safetyShutdownSelfTestStatus, * safetyShutdownSelfTestTimerCount * @return none @@ -74,28 +73,28 @@ safetyShutdownSelfTestState = SAFETY_SHUTDOWN_SELF_TEST_STATE_START; safetyShutdownSelfTestStatus = SELF_TEST_STATUS_IN_PROGRESS; safetyShutdownSelfTestTimerCount = 0; - CLR_SAFETY_SHUTDOWN(); + clear_saftety_shutdown(); } /*********************************************************************//** * @brief * The activateSafetyShutdown function activates the safety shutdown signal. - * @details Inputs: none - * @details Outputs: Safety shutdown signal output set to active state. + * @details \b Inputs: none + * @details \b Outputs: Safety shutdown signal output set to active state. * @return none *************************************************************************/ void activateSafetyShutdown( void ) { - SET_SAFETY_SHUTDOWN(); + set_safety_shutdown(); safetyShutdownActivated = TRUE; } /*********************************************************************//** * @brief * The isSafetyShutdownActivated function returns whether the safety shutdown * signal has been activated. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return safetyShutdownActivated *************************************************************************/ BOOL isSafetyShutdownActivated( void ) @@ -107,9 +106,12 @@ * @brief * The execSafetyShutdownTest function executes the safety shutdown test. * This function should be called periodically until a pass or fail - * result is returned. - * @details Inputs: safetyShutdownSelfTestState - * @details Outputs: safetyShutdownSelfTestState + * result is returned. This function primarily checks when safety shutdown + * activated/ deactivated, the corresponding voltage is seen or not. + * @details \b Inputs: safetyShutdownSelfTestState + * @details \b Outputs: safetyShutdownSelfTestState + * @details \b Alarms: ALARM_ID_DD_SAFETY_SHUTDOWN_POST_TEST_FAILED, + * SW_FAULT_ID_SAFETY_SHUTDOWN_INVALID_SELF_TEST_STATE * @return in progress, passed, or failed *************************************************************************/ SELF_TEST_STATUS_T execSafetyShutdownTest( void ) @@ -133,11 +135,11 @@ // // Verify 24V is down when w.d. expired // if ( ( v24 > MAX_24V_LEVEL_ON_SAFETY_SHUTDOWN ) || ( isolatedV24 > MAX_ISOLATED_24V_LEVEL_ON_SS_EXPIRED ) ) // { -// SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_SAFETY_SHUTDOWN_POST_TEST_FAILED, 1.0, v24 ); +// SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_SAFETY_SHUTDOWN_POST_TEST_FAILED, 1.0, v24 ); // safetyShutdownSelfTestStatus = SELF_TEST_STATUS_FAILED; // } safetyShutdownSelfTestTimerCount = getMSTimerCount(); - CLR_SAFETY_SHUTDOWN(); + clear_saftety_shutdown(); safetyShutdownActivated = FALSE; safetyShutdownSelfTestState = SAFETY_SHUTDOWN_SELF_TEST_STATE_RECOVER; } @@ -153,7 +155,7 @@ // if ( ( v24 < MIN_24V_LEVEL_ON_SAFETY_RECOVER ) || ( isolatedV24 < MAX_ISOLATED_24V_LEVEL_ON_SS_EXPIRED ) ) // { // // TODO - If issue persisted talk with systems why 24V does not recover fully. -// SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DG_SAFETY_SHUTDOWN_POST_TEST_FAILED, 2.0, v24 ); +// SET_ALARM_WITH_2_F32_DATA( ALARM_ID_DD_SAFETY_SHUTDOWN_POST_TEST_FAILED, 2.0, v24 ); // safetyShutdownSelfTestStatus = SELF_TEST_STATUS_FAILED; // } // else @@ -173,7 +175,7 @@ default: result = SELF_TEST_STATUS_FAILED; - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_SOFTWARE_FAULT, SW_FAULT_ID_SAFETY_SHUTDOWN_INVALID_SELF_TEST_STATE, safetyShutdownSelfTestState ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_SAFETY_SHUTDOWN_INVALID_SELF_TEST_STATE, safetyShutdownSelfTestState ) break; } @@ -183,8 +185,8 @@ /*********************************************************************//** * @brief * The resetSafetyShutdownPOSTState function resets the safety shutdown POST state. - * @details Inputs: none - * @details Outputs: safetyShutdownSelfTestState + * @details \b Inputs: none + * @details \b Outputs: safetyShutdownSelfTestState * @return none *************************************************************************/ void resetSafetyShutdownPOSTState( void ) @@ -195,8 +197,8 @@ /*********************************************************************//** * @brief * The testSetSafetyShutdownOverride function overrides the HD safety shutdown. - * @details Inputs: none - * @details Outputs: HD safety shutdown overridden + * @details \b Inputs: none + * @details \b Outputs: HD safety shutdown overridden * @param value TRUE to activate safety shutdown, FALSE to de-activate it * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -216,7 +218,7 @@ else { safetyShutdownActivated = FALSE; - CLR_SAFETY_SHUTDOWN(); + clear_saftety_shutdown(); } result = TRUE; } @@ -228,8 +230,8 @@ * @brief * The testResetSafetyShutdownOverride function resets the override of the * HD safety shutdown. - * @details Inputs: none - * @details Outputs: shutdown override reset + * @details \b Inputs: none + * @details \b Outputs: shutdown override reset * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetSafetyShutdownOverride( void ) @@ -245,7 +247,7 @@ else { safetyShutdownActivated = FALSE; - CLR_SAFETY_SHUTDOWN(); + clear_saftety_shutdown(); } result = TRUE; } Index: firmware/App/Modes/ModeFault.c =================================================================== diff -u -rcd3af1ebb7396ba3b2bec1d779510d29c30014f4 -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision cd3af1ebb7396ba3b2bec1d779510d29c30014f4) +++ firmware/App/Modes/ModeFault.c (.../ModeFault.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -44,8 +44,8 @@ /*********************************************************************//** * @brief * The initFaultMode function initializes the Fault Mode module. - * @details Inputs: none - * @details Outputs: Fault mode module initialized + * @details \b Inputs : none + * @details \b Outputs: Fault mode module initialized * @return none *************************************************************************/ void initFaultMode( void ) @@ -57,8 +57,8 @@ /*********************************************************************//** * @brief * The transitionToFaultMode function prepares for transition to fault mode. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return initial state *************************************************************************/ U32 transitionToFaultMode( void ) @@ -92,8 +92,8 @@ /*********************************************************************//** * @brief * The execFaultMode function executes the fault mode state machine. - * @details Inputs: none - * @details Outputs: Fault mode state machine executed + * @details \b Inputs: none + * @details \b Outputs: Fault mode state machine executed * @return current state of fault mode *************************************************************************/ U32 execFaultMode( void ) @@ -132,8 +132,8 @@ /*********************************************************************//** * @brief * The getCurrentFaultState function returns the current state of the fault mode. - * @details Inputs: faultState - * @details Outputs: none + * @details \b Inputs: faultState + * @details \b Outputs: none * @return current state of fault mode *************************************************************************/ DG_FAULT_STATE_T getCurrentFaultState( void ) @@ -145,8 +145,8 @@ * @brief * The deenergizeActuators function sets all the actuators to reset and * de-energized state. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @param parkPumps TRUE if concentrate pumps should be parked, FALSE if not * @return none *************************************************************************/ @@ -181,8 +181,8 @@ /*********************************************************************//** * @brief * The handleFaultStartState function handles the start state of the fault mode. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return next state *************************************************************************/ static DG_FAULT_STATE_T handleFaultStartState( void ) @@ -211,8 +211,8 @@ /*********************************************************************//** * @brief * The handleFaultRunNVPOSTsState function handles running non-volatile POSTs. - * @details Inputs: faultPOSTSelfTestResult - * @details Outputs: faultPOSTSelfTestResult + * @details \b Inputs: faultPOSTSelfTestResult + * @details \b Outputs: faultPOSTSelfTestResult * @return next state *************************************************************************/ static DG_FAULT_STATE_T handleFaultRunNVPOSTsState( void ) Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -34,7 +34,7 @@ //#include "Pressures.h" //#include "Reservoirs.h" //#include "RTC.h" -//#include "SafetyShutdown.h" +#include "SafetyShutdown.h" #include "Messaging.h" #include "TaskGeneral.h" //#include "TemperatureSensors.h" @@ -53,24 +53,24 @@ // ********** private data ********** -static DG_POST_STATE_T postState; ///< Currently active initialize & POST state. +static DD_POST_STATE_T postState; ///< Currently active initialize & POST state. static BOOL postCompleted; ///< Flag indicating POST completed. static BOOL postPassed; ///< Flag indicating all POST tests passed. static BOOL tempPOSTPassed; ///< Temporary flag indicating all POST tests completed so far have passed. static U32 startPOSTDelayCounter; ///< Start POST delay counter. // ********** private function prototypes ********** -static DG_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ); -static DG_POST_STATE_T handlePOSTStateStart( void ); +static DD_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ); +static DD_POST_STATE_T handlePOSTStateStart( void ); static SELF_TEST_STATUS_T execFWCompatibilityTest( void ); /*********************************************************************//** * @brief * The initInitAndPOSTMode function initializes the Initialization and POST * mode module. - * @details Inputs: none - * @details Outputs: postState, postCompleted, tempPOSTPassed, + * @details \b Inputs: none + * @details \b Outputs: postState, postCompleted, tempPOSTPassed, * startPOSTDelayCounter * @return none *************************************************************************/ @@ -87,8 +87,8 @@ * @brief * The transitionToInitAndPOSTMode function prepares for transition to * initialization and POST mode. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return initial state *************************************************************************/ U32 transitionToInitAndPOSTMode( void ) @@ -111,8 +111,9 @@ * @brief * The execInitAndPOSTMode function executes the initialization and POST * mode state machine. - * @details Inputs: postState - * @details Outputs: Initialization and POST mode state machine executed + * @details \b Inputs: postState + * @details \b Outputs: Initialization and POST mode state machine executed + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when any of the post step fails. * @return current state. *************************************************************************/ U32 execInitAndPOSTMode( void ) @@ -291,8 +292,8 @@ * @brief * The isPOSTCompleted function determines whether all DG POST have been run * and completed. If true, call the isPOSTPassed() to see final result (pass/fail). - * @details Inputs: postCompleted - * @details Outputs: none + * @details \b Inputs: postCompleted + * @details \b Outputs: none * @return true if all HD POST tests have completed, false if not *************************************************************************/ BOOL isPOSTCompleted( void ) @@ -304,8 +305,8 @@ * @brief * The isPOSTPassed function determines whether all HD POST have passed. * Call this function after POST is complete (call isPOSTCompleted function). - * @details Inputs: postPassed - * @details Outputs: none + * @details \b Inputs: postPassed + * @details \b Outputs: none * @return true if all HD POST tests have passed, false if not *************************************************************************/ BOOL isPOSTPassed( void ) @@ -316,23 +317,23 @@ /*********************************************************************//** * @brief * The handlePOSTStatus function handles a status result returned by a POST function. - * @details Inputs: postPassed - * @details Outputs: none + * @details \b Inputs: postPassed + * @details \b Outputs: none * @param testStatus status reported by last test * @return recommended next POST state *************************************************************************/ -static DG_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ) +static DD_POST_STATE_T handlePOSTStatus( SELF_TEST_STATUS_T testStatus ) { - DG_POST_STATE_T result = postState; + DD_POST_STATE_T result = postState; if ( ( SELF_TEST_STATUS_PASSED == testStatus ) || ( SELF_TEST_STATUS_FAILED == testStatus ) ) { BOOL passed = ( SELF_TEST_STATUS_PASSED == testStatus ? TRUE : FALSE ); // Broadcast passed POST result - //sendPOSTTestResult( (DG_POST_STATE_T)((int)postState), passed ); + //sendPOSTTestResult( (DD_POST_STATE_T)((int)postState), passed ); // Move on to next POST test - result = (DG_POST_STATE_T)((int)postState + 1); + result = (DD_POST_STATE_T)((int)postState + 1); if ( SELF_TEST_STATUS_FAILED == testStatus ) { tempPOSTPassed = FALSE; @@ -345,13 +346,13 @@ /*********************************************************************//** * @brief * The handlePOSTStateStart function handles the POST start state. - * @details Inputs: startPOSTDelayCounter, systemREG1 - * @details Outputs: startPOSTDelayCounter, systemREG1 + * @details \b Inputs: startPOSTDelayCounter, systemREG1 + * @details \b Outputs: startPOSTDelayCounter, systemREG1 * @return next POST state *************************************************************************/ -static DG_POST_STATE_T handlePOSTStateStart( void ) +static DD_POST_STATE_T handlePOSTStateStart( void ) { - DG_POST_STATE_T state = DG_POST_STATE_START; + DD_POST_STATE_T state = DG_POST_STATE_START; // There is a delay before starting POST to make sure the CAN bus is up and listening so // when the event data can be sent @@ -378,20 +379,20 @@ * @brief * The getCurrentInitAndPOSTState function returns the current state of the * initialization and POST mode. - * @details Inputs: postState - * @details Outputs: none + * @details \b Inputs: postState + * @details \b Outputs: none * @return the current state of initialization and POST mode *************************************************************************/ -DG_POST_STATE_T getCurrentInitAndPOSTState( void ) +DD_POST_STATE_T getCurrentInitAndPOSTState( void ) { return postState; } /*********************************************************************//** * @brief * The execFWCompatibilityTest function executes the firmware compatibility test. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return in progress, passed, or failed *************************************************************************/ static SELF_TEST_STATUS_T execFWCompatibilityTest( void ) Index: firmware/App/Modes/ModeInitPOST.h =================================================================== diff -u -r8b8fff67b95805272f37855346d600599aaec03d -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/ModeInitPOST.h (.../ModeInitPOST.h) (revision 8b8fff67b95805272f37855346d600599aaec03d) +++ firmware/App/Modes/ModeInitPOST.h (.../ModeInitPOST.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -37,7 +37,7 @@ U32 transitionToInitAndPOSTMode( void ); // prepares for transition to init. & POST mode U32 execInitAndPOSTMode( void ); // execute the init. & POST mode state machine (call from OperationModes) -DG_POST_STATE_T getCurrentInitAndPOSTState( void ); // get the current state of the init. & POST mode. +DD_POST_STATE_T getCurrentInitAndPOSTState( void ); // get the current state of the init. & POST mode. BOOL isPOSTCompleted( void ); BOOL isPOSTPassed( void ); Index: firmware/App/Modes/ModeService.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Modes/ModeService.c (.../ModeService.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -22,35 +22,35 @@ #include "OperationModes.h" /** - * @addtogroup DGServiceMode + * @addtogroup DDServiceMode * @{ */ // ********** private definitions ********** // ********** private data ********** -static DG_SERVICE_STATE_T serviceState = DG_SERVICE_STATE_START; ///< Currently active service state. +static DD_SERVICE_STATE_T serviceState = DD_SERVICE_STATE_START; ///< Currently active service state. // ********** private function prototypes ********** /*********************************************************************//** * @brief * The initServiceMode function initializes the service mode module. - * @details Inputs: none - * @details Outputs: Service mode module initialized + * @details \b Inputs: none + * @details \b Outputs: Service mode module initialized * @return none *************************************************************************/ void initServiceMode( void ) { - serviceState = DG_SERVICE_STATE_START; + serviceState = DD_SERVICE_STATE_START; } /*********************************************************************//** * @brief * The transitionToServiceMode function prepares for transition to service mode. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return initial state *************************************************************************/ U32 transitionToServiceMode( void ) @@ -71,21 +71,22 @@ /*********************************************************************//** * @brief * The execServiceMode function executes the service mode state machine. - * @details Inputs: none - * @details Outputs: Service mode state machine executed + * @details \b Inputs: none + * @details \b Outputs: Service mode state machine executed + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when wrong service state invoked. * @return current state. *************************************************************************/ U32 execServiceMode( void ) { // execute current service state switch ( serviceState ) { - case DG_SERVICE_STATE_START: + case DD_SERVICE_STATE_START: break; default: SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_SOFTWARE_FAULT, SW_FAULT_ID_SERVICE_MODE_INVALID_EXEC_STATE, serviceState ) - serviceState = DG_SERVICE_STATE_START; + serviceState = DD_SERVICE_STATE_START; break; } @@ -95,11 +96,11 @@ /*********************************************************************//** * @brief * The getCurrentServiceState function returns the current state of the service mode. - * @details Inputs: serviceState - * @details Outputs: none + * @details \b Inputs: serviceState + * @details \b Outputs: none * @return the current state of service mode *************************************************************************/ -DG_SERVICE_STATE_T getCurrentServiceState( void ) +DD_SERVICE_STATE_T getCurrentServiceState( void ) { return serviceState; } Index: firmware/App/Modes/ModeService.h =================================================================== diff -u -r8b8fff67b95805272f37855346d600599aaec03d -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/ModeService.h (.../ModeService.h) (revision 8b8fff67b95805272f37855346d600599aaec03d) +++ firmware/App/Modes/ModeService.h (.../ModeService.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -38,7 +38,7 @@ U32 transitionToServiceMode( void ); // prepares for transition to service mode U32 execServiceMode( void ); // execute the service mode state machine (call from OperationModes) -DG_SERVICE_STATE_T getCurrentServiceState( void ); // get the current state of the service mode. +DD_SERVICE_STATE_T getCurrentServiceState( void ); // get the current state of the service mode. /**@}*/ Index: firmware/App/Modes/ModeStandby.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Modes/ModeStandby.c (.../ModeStandby.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -84,8 +84,8 @@ /*********************************************************************//** * @brief * The initStandbyMode function initializes the standby mode module. - * @details Inputs: none - * @details Outputs: standbyState, stopSampleWaterRequest, startSampleWaterRequest, + * @details \b Inputs: none + * @details \b Outputs: standbyState, stopSampleWaterRequest, startSampleWaterRequest, * flushFilterRequest, endSampleWaterRequest, waterSampleStartTime, * filterFlushStartTime, filterFlushPublishTimerCounter, pendingStartDGRequest, * pendingStartDGHeatDisinfectActiveCoolRequest, @@ -116,8 +116,9 @@ /*********************************************************************//** * @brief * The transitionToStandbyMode function prepares for transition to standby mode. - * @details Inputs: none - * @details Outputs: Re-initialized standby mode + * while transition, deenergize all actuators and update DD usage info to TD module. + * @details \b Inputs: none + * @details \b Outputs: Re-initialized standby mode * @return initial state *************************************************************************/ U32 transitionToStandbyMode( void ) @@ -158,8 +159,9 @@ /*********************************************************************//** * @brief * The execStandbyMode function executes the standby mode state machine. - * @details Inputs: none - * @details Outputs: Standby mode state machine executed + * @details \b Inputs: none + * @details \b Outputs: Standby mode state machine executed + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT if stanbyState is invalid. * @return current state *************************************************************************/ U32 execStandbyMode( void ) @@ -206,8 +208,8 @@ * @brief * The areInletWaterConditionsAlarmsActive function checks whether the inlet * water conditions are out of range and any of their alarms are active. - * @details Inputs: none - * @details Outputs: None + * @details \b Inputs: none + * @details \b Outputs: None * @return TRUE if any of the alarms are active, otherwise, FALSE *************************************************************************/ static BOOL areInletWaterConditionsAlarmsActive( void ) @@ -234,10 +236,10 @@ * @brief * The handleStandbyIdleState function executes the idle state of the * standby mode state machine. - * @details Inputs: pendingSampleWaterRequest, pendingStartDGRequest, + * @details \b Inputs: pendingSampleWaterRequest, pendingStartDGRequest, * pendingStartDGFlushRequest, pendingStartDGHeatDisinfectRequest, * pendingStartDGChemicalDisinfectRequest - * @details Outputs: Idle state of the standby mode executed, + * @details \b Outputs: Idle state of the standby mode executed, * pendingStartDGFlushRequest, pendingStartDGHeatDisinfectRequest, * pendingStartDGChemicalDisinfectRequest * @return the next state @@ -304,8 +306,8 @@ * @brief * The handleStandbyFilterFlushState function executes the flush filter state * of the standby mode state machine. - * @details Inputs: filterFLushStartTime - * @details Outputs: Flushed the filters + * @details \b Inputs: filterFLushStartTime + * @details \b Outputs: Flushed the filters * @return the next state *************************************************************************/ static DG_STANDBY_MODE_STATE_T handleStandbyFlushFilterState( void ) @@ -344,8 +346,8 @@ * @brief * The handleStandbyFlushFilterIdleState function executes the flush filter * idle state of the standby mode state machine. - * @details Inputs: filterFLushStartTime, startSampleWaterRequest, endSampleWaterRequest - * @details Outputs: Flushed the filters, startSampleWaterRequest, endSampleWaterRequest, + * @details \b Inputs: filterFLushStartTime, startSampleWaterRequest, endSampleWaterRequest + * @details \b Outputs: Flushed the filters, startSampleWaterRequest, endSampleWaterRequest, * waterSampleStartTime * @return the next state *************************************************************************/ @@ -377,8 +379,8 @@ * @brief * The handleStandbySampleWaterState function executes the sample water state * of the standby mode state machine. - * @details Inputs: stopSampleWaterRequest, waterSampleStartTime - * @details Outputs: Finished sample water and closed valve + * @details \b Inputs: stopSampleWaterRequest, waterSampleStartTime + * @details \b Outputs: Finished sample water and closed valve * @return the next state *************************************************************************/ static DG_STANDBY_MODE_STATE_T handleStandbySampleWaterState( void ) @@ -400,8 +402,8 @@ /*********************************************************************//** * @brief * The handleStandbyPauseState function executes the pause state. - * @details Inputs: none - * @details Outputs: filterFlushStartTime + * @details \b Inputs: none + * @details \b Outputs: filterFlushStartTime * @return the next state *************************************************************************/ static DG_STANDBY_MODE_STATE_T handleStandbyPauseState( void ) @@ -420,8 +422,8 @@ /*********************************************************************//** * @brief * The requestWaterSample function handles an HD request to sample water. - * @details Inputs: standbyState - * @details Outputs: pendingSampleWaterRequest + * @details \b Inputs: standbyState + * @details \b Outputs: pendingSampleWaterRequest * @return TRUE if request accepted, FALSE if not. *************************************************************************/ void waterSampleCommandHandler( SAMPLE_WATER_CMD_T sampleWaterCmd ) @@ -481,8 +483,8 @@ /*********************************************************************//** * @brief * The requestDGStart function handles an HD request to start (go to generation idle mode). - * @details Inputs: standbyState - * @details Outputs: pendingSampleWaterRequest + * @details \b Inputs: standbyState + * @details \b Outputs: pendingSampleWaterRequest * @return TRUE if request accepted, FALSE if not. *************************************************************************/ BOOL requestDGStart( void ) @@ -505,8 +507,8 @@ * @brief * The signalAbortWaterSampling function handles an HD request to abort water * sampling (return to standby idle state). - * @details Inputs: none - * @details Outputs: standby mode variable initialized + * @details \b Inputs: none + * @details \b Outputs: standby mode variable initialized * @return TRUE if request accepted, FALSE if not *************************************************************************/ BOOL signalAbortWaterSampling( void ) @@ -527,8 +529,8 @@ /*********************************************************************//** * @brief * The startDGFlush function starts DG flush mode. - * @details Inputs: standbyState - * @details Outputs: none + * @details \b Inputs: standbyState + * @details \b Outputs: none * @return: TRUE if the switch was successful, otherwise FALSE *************************************************************************/ BOOL startDGFlush( void ) @@ -587,8 +589,8 @@ /*********************************************************************//** * @brief * The startDGHeatDisinfect function starts heat disinfect mode. - * @details Inputs: standbyState - * @details Outputs: none + * @details \b Inputs: standbyState + * @details \b Outputs: none * @return: TRUE if the switch was successful *************************************************************************/ BOOL startDGHeatDisinfect( void ) @@ -648,8 +650,8 @@ * @brief * The startDGHeatDisinfectActiveCool function starts heat disinfect active * cool mode. - * @details Inputs: standbyState - * @details Outputs: none + * @details \b Inputs: standbyState + * @details \b Outputs: none * @return: TRUE if the switch was successful *************************************************************************/ BOOL startDGHeatDisinfectActiveCool( void ) @@ -708,8 +710,8 @@ /*********************************************************************//** * @brief * The startDGChemicalDisinfect function starts chemical disinfect mode. - * @details Inputs: standbyState - * @details Outputs: none + * @details \b Inputs: standbyState + * @details \b Outputs: none * @return: TRUE if the switch was successful *************************************************************************/ BOOL startDGChemicalDisinfect( void ) @@ -755,8 +757,8 @@ /*********************************************************************//** * @brief * The startDGChemicalDisinfectFlush function starts chemical disinfect flush mode. - * @details Inputs: standbyState - * @details Outputs: none + * @details \b Inputs: standbyState + * @details \b Outputs: none * @return: TRUE if the switch was successful *************************************************************************/ BOOL startDGChemicalDisinfectFlush( void ) @@ -809,8 +811,8 @@ /*********************************************************************//** * @brief * The startDGROPermeateSample function starts RO permeate sample mode. - * @details Inputs: standbyState - * @details Outputs: pendingStartDGChemicalDisinfectFlushRequest + * @details \b Inputs: standbyState + * @details \b Outputs: pendingStartDGChemicalDisinfectFlushRequest * @return: TRUE if the switch was successful *************************************************************************/ BOOL startDGROPermeateSample( void ) @@ -874,8 +876,8 @@ /*********************************************************************//** * @brief * The getCurrentStandbyState function returns the current state of standby mode. - * @details Inputs: standbyState - * @details Outputs: none + * @details \b Inputs: standbyState + * @details \b Outputs: none * @return the current state of standby mode. *************************************************************************/ DG_STANDBY_MODE_STATE_T getCurrentStandbyState( void ) @@ -893,8 +895,8 @@ * @brief * The testSetFilterFlushTimePeriodOverride function overrides the filter * flush time period. - * @details Inputs: none - * @details Outputs: filterFlushTimePeriod + * @details \b Inputs: none + * @details \b Outputs: filterFlushTimePeriod * @param value override concentrate pump data publish interval with (in ms) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -916,8 +918,8 @@ * @brief * The testResetFilterFlushTimePeriodOverride function resets the * override of the filter flush time period. - * @details Inputs: none - * @details Outputs: filterFlushTimePeriod + * @details \b Inputs: none + * @details \b Outputs: filterFlushTimePeriod * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetFilterFlushTimePeriodOverride( void ) Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -55,6 +55,8 @@ static DD_OP_MODE_T lastMode; ///< Last operation mode prior to current mode. static DD_OP_MODE_T currentMode; ///< The currently active mode. static U32 currentSubMode; ///< The currently active state of the active mode. +static TD_MODE_SUB_MODE_T tdModes; ///< TD operations mode. + /// DG operation mode data publish interval. static OVERRIDE_U32_T dgOpModePublishInterval = { BROADCAST_DG_OP_MODE_INTERVAL, BROADCAST_DG_OP_MODE_INTERVAL, 0, 0 }; static U32 dataPublishCounter; ///< Interval counter used to determine when to broadcast operation mode. Initialize to 11 to stagger broadcast. @@ -63,21 +65,15 @@ /// This matrix determines legal transitions from one mode to another. static const DD_OP_MODE_T MODE_TRANSITION_TABLE[ NUM_OF_DD_MODES - 1 ][ NUM_OF_DD_MODES - 1 ] = { - // from to-> FAULT SERVICE INIT STANBY STBY-SOLO GEN-IDLE FILL DRAIN FLUSH HEAT DIS CHEM DIS CHEM_FLUSH HEAT_COOL RO_PER_SAMPLE - /* FAUL */{ DD_MODE_FAUL, DD_MODE_SERV, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* SERV */{ DD_MODE_NLEG, DD_MODE_SERV, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* INIT *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_INIT, DD_MODE_STAN, DG_MODE_SOLO, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* STAN *///{ DD_MODE_FAUL, DD_MODE_SERV, DD_MODE_INIT, DD_MODE_STAN, DG_MODE_SOLO, DG_MODE_GENE, DD_MODE_NLEG, DD_MODE_NLEG, DG_MODE_FLUS, DD_MODE_HEAT, DG_MODE_CHEM, DG_MODE_CHFL, DD_MODE_HCOL, DD_MODE_ROPS }, - /* SOLO *///{ DD_MODE_FAUL, DD_MODE_SERV, DD_MODE_INIT, DD_MODE_STAN, DG_MODE_SOLO, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DG_MODE_FLUS, DD_MODE_HEAT, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_HCOL, DD_MODE_ROPS }, - /* GENE *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DG_MODE_GENE, DG_MODE_FILL, DG_MODE_DRAI, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* FILL *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DG_MODE_GENE, DG_MODE_FILL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* DRAI *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DG_MODE_GENE, DD_MODE_NLEG, DG_MODE_DRAI, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* FLUS *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DG_MODE_SOLO, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DG_MODE_FLUS, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, - /* HEAT *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DG_MODE_SOLO, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_HEAT, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_HCOL, DD_MODE_NLEG }, - /* CHEM *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DG_MODE_CHEM, DG_MODE_CHFL, DD_MODE_NLEG, DD_MODE_NLEG }, - /* CHFL *///{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DG_MODE_CHFL, DD_MODE_NLEG, DD_MODE_NLEG }, - /* HCOL */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_HCOL, DD_MODE_NLEG }, - /* ROPS */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_ROPS }, + // from to-> FAULT SERVICE INIT STANBY GEND HEAT HCOL ROPS + /* FAUL */{ DD_MODE_FAUL, DD_MODE_SERV, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, + /* SERV */{ DD_MODE_NLEG, DD_MODE_SERV, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, + /* INIT */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_INIT, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, + /* STAN */{ DD_MODE_FAUL, DD_MODE_SERV, DD_MODE_INIT, DD_MODE_STAN, DD_MODE_GEND, DD_MODE_HEAT, DD_MODE_HCOL, DD_MODE_ROPS }, + /* GEND */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_GEND, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG }, + /* HEAT */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_HEAT, DD_MODE_HCOL, DD_MODE_NLEG }, + /* HCOL */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_HCOL, DD_MODE_NLEG }, + /* ROPS */{ DD_MODE_FAUL, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_STAN, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_NLEG, DD_MODE_ROPS }, }; // ********** private function prototypes ********** @@ -91,8 +87,8 @@ /*********************************************************************//** * @brief * The initOperationModes function initializes the operation modes module. - * @details Inputs: none - * @details Outputs: modeRequest, lastMode, currentMode, currentSubMode, + * @details \b Inputs: none + * @details \b Outputs: modeRequest, lastMode, currentMode, currentSubMode, * dataPublishCounter * @return none *************************************************************************/ @@ -135,8 +131,13 @@ /*********************************************************************//** * @brief * The execOperationModes function executes the operation modes state machine. - * @details Inputs: currentMode, currentSubMode - * @details Outputs: currentMode, currentSubMode + * It decides new mode transition after validation and executes the required operations + * in each mode. Also, publish the events with the mode details and broadcast the operation + * mode informations. + * @details \b Inputs: currentMode, currentSubMode + * @details \b Outputs: currentMode, currentSubMode + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when illegal mode transition requested + * and invalid operation mode encountered. * @return none *************************************************************************/ void execOperationModes( void ) @@ -181,18 +182,18 @@ currentSubMode = execFaultMode(); break; -// case DD_MODE_SERV: -// currentSubMode = execServiceMode(); -// break; + case DD_MODE_SERV: + currentSubMode = execServiceMode(); + break; case DD_MODE_INIT: currentSubMode = execInitAndPOSTMode(); break; + + case DD_MODE_STAN: + currentSubMode = execStandbyMode(); + break; // -// case DD_MODE_STAN: -// currentSubMode = execStandbyMode(); -// break; -// // case DG_MODE_SOLO: // currentSubMode = execSoloMode(); // break; @@ -257,8 +258,9 @@ /*********************************************************************//** * @brief * The requestNewOperationMode function requests a new operation mode. - * @details Inputs: none - * @details Outputs: makes the requested mode "pending" + * @details \b Inputs: none + * @details \b Outputs: makes the requested mode "pending" + * @details \b Alarm : ALARM_ID_DD_SOFTWARE_FAULT when invalid mode requested * @param newMode requested mode * @return none *************************************************************************/ @@ -279,8 +281,8 @@ /*********************************************************************//** * @brief * The getCurrentOperationMode function returns the current operation mode. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return current mode *************************************************************************/ DD_OP_MODE_T getCurrentOperationMode( void ) @@ -291,8 +293,8 @@ /*********************************************************************//** * @brief * The getPreviousOperationMode function gets the previous operation mode. - * @details Inputs: lastMode - * @details Outputs: none + * @details \b Inputs: lastMode + * @details \b Outputs: none * @return the previous operation mode *************************************************************************/ DD_OP_MODE_T getPreviousOperationMode( void ) @@ -303,8 +305,8 @@ /*********************************************************************//** * @brief * The getCurrentOperationSubMode function gets the current operation submode. - * @details Inputs: currentSubMode - * @details Outputs: none + * @details \b Inputs: currentSubMode + * @details \b Outputs: none * @return the current operation submode *************************************************************************/ U32 getCurrentOperationSubMode( void ) @@ -316,8 +318,8 @@ * @brief * The arbitrateModeRequest function selects highest priority mode request * and clear all requests. - * @details Inputs: none - * @details Outputs: Arbitrated mode requests + * @details \b Inputs: none + * @details \b Outputs: Arbitrated mode requests * @return highest priority requested mode *************************************************************************/ static DD_OP_MODE_T arbitrateModeRequest( void ) @@ -354,8 +356,8 @@ * @brief * The transitionToNewOperationMode function undergo the process of transition * to new operation mode. - * @details Inputs: currentSubMode - * @details Outputs: Transition to new mode + * @details \b Inputs: currentSubMode + * @details \b Outputs: Transition to new mode * @param newMode new op mode to transition to * @return none *************************************************************************/ @@ -371,15 +373,15 @@ case DD_MODE_FAUL: currentSubMode = transitionToFaultMode(); break; -// case DD_MODE_SERV: -// currentSubMode = transitionToServiceMode(); -// break; + case DD_MODE_SERV: + currentSubMode = transitionToServiceMode(); + break; case DD_MODE_INIT: currentSubMode = transitionToInitAndPOSTMode(); break; -// case DD_MODE_STAN: -// currentSubMode = transitionToStandbyMode(); -// break; + case DD_MODE_STAN: + currentSubMode = transitionToStandbyMode(); + break; // case DG_MODE_SOLO: // currentSubMode = transitionToSoloMode(); // break; @@ -426,8 +428,8 @@ * @brief * The broadcastOperationMode function broadcasts the current operation mode at * the prescribed interval. - * @details Inputs: broadcastModeIntervalCtr - * @details Outputs: DG operation mode broadcast message sent + * @details \b Inputs: broadcastModeIntervalCtr + * @details \b Outputs: DD operation mode broadcast message sent * @return none *************************************************************************/ static void broadcastOperationMode( void ) @@ -449,8 +451,8 @@ * @brief * The getDGOpModePublishInterval function gets the current DG operation mode * data publish interval. - * @details Inputs: dgOpModePublishInterval - * @details Outputs: DG operation mode broadcast message sent + * @details \b Inputs: dgOpModePublishInterval + * @details \b Outputs: DG operation mode broadcast message sent * @return none *************************************************************************/ static U32 getDGOpModePublishInterval( void ) @@ -468,8 +470,8 @@ /*********************************************************************//** * @brief * The setCurrentSubState function sets the current subState. - * @details Inputs: subState - * @details Outputs: currentSubState + * @details \b Inputs: subState + * @details \b Outputs: currentSubState * @param subState the enumerated sub state. * @return none *************************************************************************/ @@ -482,8 +484,8 @@ * @brief * The sendOperationStatusEvent function constructs and sends an DG operation * status event. - * @details Inputs: currentMode, currentSubMode, currentSubState - * @details Outputs: dat1, dat2. + * @details \b Inputs: currentMode, currentSubMode, currentSubState + * @details \b Outputs: dat1, dat2. * @return none *************************************************************************/ static void sendOperationStatusEvent() @@ -503,7 +505,40 @@ sendEvent( DG_EVENT_OPERATION_STATUS, dat1, dat2 ); } +/*********************************************************************//** + * @brief + * The setTDOperationMode function sets TD operation mode value. + * @details \b Inputs: none + * @details \b Outputs: tdMode + * @param mode which is TD mode + * @param subMode which is TD submode + * @return none + *************************************************************************/ +void setTDOperationMode( U32 mode, U32 subMode ) +{ + // thread protection for queue operations + _disable_IRQ(); + tdModes.tdMode = (TD_OP_MODE_T)mode; + tdModes.tdSubMode = subMode; + // release thread protection + _enable_IRQ(); +} +/*********************************************************************//** + * @brief + * The getTDOperationMode function copies the provided buffer with the TD + * mode and submode. + * @details \b Inputs: none + * @details \b Outputs: TdMode + * @param mode* pointer to the buffer of type TD_MODE_SUB_MODE_T + * @return none + *************************************************************************/ +void getTDOperationMode( TD_MODE_SUB_MODE_T* mode ) +{ + mode->tdMode = tdModes.tdMode; + mode->tdSubMode = tdModes.tdSubMode; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -513,8 +548,8 @@ * @brief * The testSetOperationMode function will transition to a given operation * mode if the transition is legal. - * @details Inputs: MODE_TRANSITION_TABLE[][] - * @details Outputs: modeRequest[], result + * @details \b Inputs: MODE_TRANSITION_TABLE[][] + * @details \b Outputs: modeRequest[], result * @param newMode ID of requested mode to transition to * @return TRUE if request successful, FALSE if not *************************************************************************/ @@ -541,8 +576,8 @@ * @brief * The testSetDGOpModePublishIntervalOverride function overrides the * DG operation mode publish interval. - * @details Inputs: none - * @details Outputs: dgOpModePublishInterval + * @details \b Inputs: none + * @details \b Outputs: dgOpModePublishInterval * @param value override DG operation mode publish interval with (in ms) * @return TRUE if override successful, FALSE if not *************************************************************************/ @@ -566,8 +601,8 @@ * @brief * The testResetDGOpModePublishIntervalOverride function resets the * override of the DG operation mode publish interval. - * @details Inputs: none - * @details Outputs: dgOpModePublishInterval + * @details \b Inputs: none + * @details \b Outputs: dgOpModePublishInterval * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetDGOpModePublishIntervalOverride( void ) Index: firmware/App/Modes/OperationModes.h =================================================================== diff -u -rcd3af1ebb7396ba3b2bec1d779510d29c30014f4 -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision cd3af1ebb7396ba3b2bec1d779510d29c30014f4) +++ firmware/App/Modes/OperationModes.h (.../OperationModes.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -20,7 +20,7 @@ #include "DDCommon.h" #include "DDDefs.h" - +#include "TDDefs.h" /** * @defgroup DGOperationModes DGOperationModes * @brief Operation Modes module. Manages the top level operation modes of the DG via a state machine. @@ -40,6 +40,12 @@ U32 currentSubMode; ///< Current Submode. } OP_MODES_DATA_T; +/// TD mode and TD submode +typedef struct +{ + TD_OP_MODE_T tdMode; ///< TD mode + U32 tdSubMode; ///< TD submode +} TD_MODE_SUB_MODE_T; // ********** public function prototypes ********** void initOperationModes( void ); // initialize this module @@ -50,6 +56,9 @@ U32 getCurrentOperationSubMode( void ); // get current operation sub mode void setCurrentSubState( U32 subState ); // Set the current substate. +void setTDOperationMode( U32 mode, U32 subMode ); // set TD operation mode which is received from TD +void getTDOperationMode( TD_MODE_SUB_MODE_T* mode ); // get TD operation mode + BOOL testSetOperationMode( DD_OP_MODE_T newMode ); // Force transition to a given mode (if allowed) BOOL testSetDGOpModePublishIntervalOverride( U32 value ); BOOL testResetDGOpModePublishIntervalOverride( void ); Index: firmware/App/Services/AlarmMgmtDD.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/AlarmMgmtDD.c (.../AlarmMgmtDD.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/AlarmMgmtDD.c (.../AlarmMgmtDD.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -20,7 +20,7 @@ #include "OperationModes.h" #include "PersistentAlarm.h" //#include "Reservoirs.h" -//#include "SafetyShutdown.h" +#include "SafetyShutdown.h" #include "TaskGeneral.h" #include "Timers.h" #include "Messaging.h" @@ -48,8 +48,6 @@ // ********** private data ********** -//static BOOL alarmIsActive[ NUM_OF_ALARM_IDS ]; ///< Array of current state of each alarm -//static BOOL alarmConditionIsActive[ NUM_OF_ALARM_IDS ]; ///< Array of flag indicates if an alarm condition is active static U32 alarmInfoPublicationTimerCounter; ///< Used to schedule alarm information publication to CAN bus. static BOOL isAFaultAlarmActive; ///< Boolean flag to indicate whether a DG fault alarm is active. /// Interval (in task intervals) at which to publish alarm information to CAN bus. @@ -64,32 +62,26 @@ /*********************************************************************//** * @brief * The initAlarmMgmtDD function initializes the AlarmMgmt module. - * @details Inputs: none - * @details Outputs: alarmInfoPublicationTimerCounter, alarmLEDTimer, + * @details \b Inputs: none + * @details \b Outputs: alarmInfoPublicationTimerCounter, alarmLEDTimer, * isAFaultAlarmActive, alarmIsActive, alarmIsDetected * @return none *************************************************************************/ void initAlarmMgmtDD( void ) { - ALARM_ID_T alrm; - alarmInfoPublicationTimerCounter = DATA_PUBLISH_COUNTER_START_COUNT; alarmLEDTimer = 0; - isAFaultAlarmActive = FALSE; - - // initialize alarm states and start time stamps - for ( alrm = ALARM_ID_NO_ALARM; alrm < NUM_OF_ALARM_IDS; alrm++ ) - { - setAlarmActive( alrm, FALSE ); - setAlarmConditionDetected( alrm, FALSE ); - } + isAFaultAlarmActive = FALSE; + + // Initialize common alarm mgmt unit + initAlarmMgmt(); } /*********************************************************************//** * @brief * The execAlarmMgmt function executes the alarm management module. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return none *************************************************************************/ void execAlarmMgmt( void ) @@ -100,9 +92,11 @@ /*********************************************************************//** * @brief - * The activateAlarmDD function activates a given alarm. - * @details Inputs: none - * @details Outputs: alarmIsActive[], isAFaultAlarmActive + * The activateAlarmDD function activates a given alarm. if the alarm is + * DD fault, transition fault operation mode immediately. + * @details \b Inputs: none + * @details \b Outputs: alarmIsActive[], isAFaultAlarmActive + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid alarm asked to activate. * @param alarm ID of alarm to activate * @return none *************************************************************************/ @@ -141,9 +135,10 @@ /*********************************************************************//** * @brief * The activateAlarmNoData function activates a given alarm. An alarm message - * is broadcast to the rest of the system. - * @details Inputs: none - * @details Outputs: alarm triggered message sent, alarm activated + * is broadcast to the rest of the system.it doesn't contain any parameters + * associated to alarm. + * @details \b Inputs: none + * @details \b Outputs: alarm triggered message sent, alarm activated * @param alarm ID of alarm to activate * @return none *************************************************************************/ @@ -157,8 +152,8 @@ * The activateAlarm1Data function activates a given alarm. An alarm message * is broadcast to the rest of the system. This function will include given * data in the broadcast message for logging. - * @details Inputs: none - * @details Outputs: alarm triggered message sent, alarm activated + * @details \b Inputs: none + * @details \b Outputs: alarm triggered message sent, alarm activated * @param alarm ID of alarm to activate * @param alarmData supporting data to include in alarm message * @return none @@ -173,8 +168,8 @@ * The activateAlarm2Data function activates a given alarm. An alarm message * is broadcast to the rest of the system. This function will include * two given data in the broadcast message for logging. - * @details Inputs: none - * @details Outputs: alarm triggered message sent, alarm activated + * @details \b Inputs: none + * @details \b Outputs: alarm triggered message sent, alarm activated * @param alarm ID of alarm to activate * @param alarmData1 supporting data to include in alarm message * @param alarmData2 supporting data to include in alarm message @@ -183,30 +178,32 @@ *************************************************************************/ void activateAlarm2Data( ALARM_ID_T alarm, ALARM_DATA_T alarmData1, ALARM_DATA_T alarmData2, BOOL outside ) { -// HD_MODE_SUB_MODE_T hdModes; + TD_MODE_SUB_MODE_T tdModes; ALARM_T props = getAlarmProperties( alarm ); - //getHDOperationMode( &hdModes ); + getTDOperationMode( &tdModes ); // prevent alarm trigger if property blocks in current mode/state -// if ( ( ( props.alarmBlockRinseback != TRUE ) || ( hdModes.hdMode != MODE_TREA ) || ( hdModes.hdSubMode != TREATMENT_RINSEBACK_STATE ) ) && -// ( ( props.alarmBlockEndTx != TRUE ) || ( hdModes.hdMode != MODE_POST ) ) ) -// { + if ( ( ( props.alarmBlockRinseback != TRUE ) || ( tdModes.tdMode != MODE_TREA ) || ( tdModes.tdSubMode != TREATMENT_RINSEBACK_STATE ) ) && + ( ( props.alarmBlockEndTx != TRUE ) || ( tdModes.tdMode != MODE_POST ) ) ) + { // broadcast alarm and data if alarm not already active if ( ( FALSE == isAlarmActive( alarm ) ) && ( TRUE == isTDCommunicating() ) ) { broadcastAlarmTriggered( alarm, alarmData1, alarmData2 ); } activateAlarmDD( alarm ); -// } + } } /*********************************************************************//** * @brief * The clearAlarmDD function clears a given alarm if it is recoverable. * An alarm message is broadcast to the rest of the system. - * @details Inputs: none - * @details Outputs: AlarmStatusTable[] + * @details \b Inputs: none + * @details \b Outputs: AlarmStatusTable[] + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid alarm needs + * to be cleared. * @param alarm ID of alarm to clear * @return none *************************************************************************/ @@ -238,8 +235,10 @@ * @brief * The clearAlarmConditionDD function clears a given alarm's condition detected * flag. Also an alarm message is broadcast to the rest of the system. - * @details Inputs: none - * @details Outputs: alarmIsDetected[] + * @details \b Inputs: none + * @details \b Outputs: alarmIsDetected[] + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid alarm conditioned + * needs to be cleared * @param alarm ID of alarm to clear condition for * @return none *************************************************************************/ @@ -268,8 +267,8 @@ * @brief * The isDGFaultAlarmActive function determines whether a fault alarm is currently * active. - * @details Inputs: alarmStatus - * @details Outputs: none + * @details \b Inputs: alarmStatus + * @details \b Outputs: none * @return TRUE if any alarm is active, FALSE if not *************************************************************************/ BOOL isDGFaultAlarmActive( void ) @@ -281,20 +280,20 @@ * @brief * The publishAlarmInfo function publishes alarm information at the set * interval. - * @details Inputs: - * @details Outputs: alarm information are published to CAN bus. + * @details \b Inputs: + * @details \b Outputs: alarm information are published to CAN bus. * @return none *************************************************************************/ static void publishAlarmInfo( void ) { // Publish voltages monitor data on interval if ( ++alarmInfoPublicationTimerCounter >= getU32OverrideValue( &alarmInfoPublishInterval ) ) { - //SAFETY_SHUTDOWN_ACTIVATION_DATA_T data; + SAFETY_SHUTDOWN_ACTIVATION_DATA_T data; - //data.safetyShutdownStatus = (U32)isSafetyShutdownActivated(); + data.safetyShutdownStatus = (U32)isSafetyShutdownActivated(); - //broadcastData( MSG_ID_DG_ALARM_INFO_DATA, COMM_BUFFER_OUT_CAN_DD_ALARM, (U08*)&data, sizeof( SAFETY_SHUTDOWN_ACTIVATION_DATA_T ) ); + broadcastData( MSG_ID_DD_ALARM_INFO_DATA, COMM_BUFFER_OUT_CAN_DD_ALARM, (U08*)&data, sizeof( SAFETY_SHUTDOWN_ACTIVATION_DATA_T ) ); //broadcastCPLDStatus(); alarmInfoPublicationTimerCounter = 0; } @@ -304,8 +303,8 @@ * @brief * The handleResendActiveAlarmsRequest function processes the request to re-send * all active alarms. -* @details Inputs: alarmIsActive[] -* @details Outputs: re-send active alarms to UI +* @details \b Inputs: alarmIsActive[] +* @details \b Outputs: re-send active alarms to UI * @return none *************************************************************************/ void handleResendActiveAlarmsRequest( void ) @@ -325,8 +324,8 @@ * @brief * The isAnyCleaningModeInletWaterConditionActive function returns the status * of any of the inlet water conditions is active or not in a cleaning mode -* @details Inputs: none -* @details Outputs: none +* @details \b Inputs: none +* @details \b Outputs: none * @return TRUE if any of the inlet water conditions is active otherwise, FALSE *************************************************************************/ BOOL isAnyCleaningModeInletWaterConditionActive( void ) @@ -348,8 +347,8 @@ * @brief * The isTransitionToFaultRequired function checks whether the alarm management * should request a transition to fault mode immediately or it should be deferred - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return TRUE if transition to fault is required otherwise, FALSE *************************************************************************/ static BOOL isTransitionToFaultRequired( void ) @@ -386,8 +385,8 @@ * The testClearAllAlarms function clears all active alarms, even if they * are non-recoverable or faults. The caller of this function must provide * the correct 32-bit key. A Dialin user must also be logged into DG. - * @details Inputs: none - * @details Outputs: alarmIsActive[], alarmStartedAt[] + * @details \b Inputs: none + * @details \b Outputs: alarmIsActive[], alarmStartedAt[] * @param key 32-bit supervisor alarm key required to perform this function * @return TRUE if override reset successful, FALSE if not *************************************************************************/ @@ -427,8 +426,8 @@ * @brief * The testSetAlarmInfoPublishIntervalOverride function sets the override of the * alarm information publication interval. - * @details Inputs: none - * @details Outputs: alarmInfoPublishInterval + * @details \b Inputs: none + * @details \b Outputs: alarmInfoPublishInterval * @param ms milliseconds between alarm info broadcasts * @return TRUE if override set successful, FALSE if not *************************************************************************/ @@ -452,8 +451,8 @@ * @brief * The testResetAlarmInfoPublishIntervalOverride function resets the override of the * alarm information publication interval. - * @details Inputs: none - * @details Outputs: alarmInfoPublishInterval + * @details \b Inputs: none + * @details \b Outputs: alarmInfoPublishInterval * @return TRUE if override reset successful, FALSE if not *************************************************************************/ BOOL testResetAlarmInfoPublishIntervalOverride( void ) Index: firmware/App/Services/AlarmMgmtSWFaults.h =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/AlarmMgmtSWFaults.h (.../AlarmMgmtSWFaults.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -43,8 +43,8 @@ SW_FAULT_ID_COMM_BUFFERS_GET_INVALID_BUFFER, SW_FAULT_ID_COMM_BUFFERS_PEEK_INVALID_BUFFER, SW_FAULT_ID_COMM_BUFFERS_COUNT_INVALID_BUFFER, - SW_FAULT_ID_FPGA_INVALID_IN_STATE, // 15 - SW_FAULT_ID_FPGA_INVALID_OUT_STATE, + SW_FAULT_ID_FPGA_INVALID_STATE, // 15 + SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_CLEAR_COND, SW_FAULT_ID_FPGA_WRITE_CMD_TOO_MUCH_DATA, SW_FAULT_ID_FPGA_WRITE_RSP_TOO_MUCH_DATA, SW_FAULT_ID_FPGA_READ_CMD_TOO_MUCH_DATA, @@ -124,7 +124,7 @@ SW_FAULT_ID_INVALID_TASK, SW_FAULT_ID_INVALID_VOLTAGE_MONITOR_STATE, SW_FAULT_ID_INVALID_MONITORED_VOLTAGE_ID, // 95 - SW_FAULT_ID_AVAILABLE_2, + SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_GET_PROPS, SW_FAULT_ID_DD_CHEM_DISINFECT_INVALID_EXEC_STATE, SW_FAULT_ID_DD_INVALID_SWITCH_ID, SW_FAULT_ID_DD_PRESSURES_INVALID_SELF_TEST_STATE, @@ -147,11 +147,12 @@ SW_FAULT_ID_DG_CHEM_DISINFECT_FLUSH_INVALID_EXEC_STATE, SW_FAULT_ID_INVALID_PI_PROFILE_SELECTED, SW_FAULT_ID_PI_CTRL_INVALID_STEP_LIMIT, - SW_FAULT_ID_AVAILABLE_3, + SW_FAULT_ID_ALARM_MGMT_INVALID_ALARM_TO_GET_RANK, SW_FAULT_ID_DD_INVALID_TEST_CONFIG_SELECTED, // 120 SW_FAULT_ID_DD_INVALID_TEST_CONFIG_SELECTED1, SW_FAULT_ID_DD_INVALID_TEST_CONFIG_SELECTED2, SW_FAULT_ID_DD_INVALID_COND_SNSNR_CAL_TABLE_SELECTED, + SW_FAULT_ID_INVALID_ALARM_ID_REFERENCED3, NUM_OF_SW_FAULT_IDS } SW_FAULT_ID_T; Index: firmware/App/Services/CommBuffers.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -48,8 +48,8 @@ /*********************************************************************//** * @brief * The initCommBuffers function initializes the CommBuffers module. - * @details Inputs: none - * @details Outputs: CommBuffers module initialized. + * @details \b Inputs: none + * @details \b Outputs: CommBuffers module initialized. * @return none *************************************************************************/ void initCommBuffers( void ) @@ -65,11 +65,12 @@ /*********************************************************************//** * @brief - * The clearBuffer function clears (empties) a given buffer. Caller should - * ensure buffer won't be used while this function is clearing the buffer. - * @details Inputs: none - * @details Outputs: given buffer is cleared - * @param buffer the buffer to clear + * The clearBuffer function clears (empties) a given buffer. + * @details \b Inputs: none + * @details \b Outputs: given buffer is cleared + * @param buffer the buffer to clear + * @warning Caller should ensure buffer won't be used while this function + * is clearing the buffer. * @return none *************************************************************************/ void clearBuffer( COMM_BUFFER_T buffer ) @@ -96,14 +97,16 @@ /*********************************************************************//** * @brief * The addToCommBuffer function adds data of specified length to a specified - * communication buffer. S/W fault if buffer too full to add data. This function - * will always add to the active double buffer. This function should only be called - * from the background, general, or priority tasks (BG or IRQ) for thread safety. - * @details Inputs: commBufferByteCount[], activeDoubleBuffer[] - * @details Outputs: commBuffers[], commBufferByteCount[] + * communication buffer. This function will always add to the active double buffer. + * @details \b Inputs: commBufferByteCount[], activeDoubleBuffer[] + * @details \b Outputs: commBuffers[], commBufferByteCount[] + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when buffer too full to add data and/or + * when invalid buffer given. * @param buffer which comm buffer to add data to * @param data pointer to byte array containing data to add - * @param len length of data (in bytes) + * @param len length of data (in bytes) + * @warning This function should only be called + * from the background, general, or priority tasks (BG or IRQ) for thread safety. * @return TRUE if data added to buffer successfully, FALSE if not *************************************************************************/ BOOL addToCommBuffer( COMM_BUFFER_T buffer, U08* data, U32 len ) @@ -187,14 +190,15 @@ * The getFromCommBuffer function fills a given byte array with a given number * of bytes from a given buffer and returns the number of bytes retrieved from * the buffer. This function will draw from the inactive double buffer first and, - * if needed, switch double buffers to draw the rest of the requested data. Only - * one function in one thread should be calling this function for a given buffer. - * @details Inputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[] - * @details Outputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[], + * if needed, switch double buffers to draw the rest of the requested data. + * @details \b Inputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[] + * @details \b Outputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[], * and the given data array is populated with data from the buffer * @param buffer which comm buffer to retrieve data from * @param data pointer to byte array to stuff data into - * @param len number of bytes to retrieve into given data array + * @param len number of bytes to retrieve into given data array + * @warning Only one function in one thread should be calling this function for + * a given buffer. * @return the number of bytes retrieved. *************************************************************************/ U32 getFromCommBuffer( COMM_BUFFER_T buffer, U08* data, U32 len ) @@ -247,8 +251,8 @@ * peeks at them. A call to numberOfBytesInCommBuffer() should be made before * calling this function to determine how many bytes are currently in the buffer. * Do not call this function with a "len" longer than what is currently in the buffer. - * @details Inputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[] - * @details Outputs: given array populated with requested number of bytes from the buffer. + * @details \b Inputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[] + * @details \b Outputs: given array populated with requested number of bytes from the buffer. * @param buffer which comm buffer to retrieve data from * @param data pointer to byte array to stuff data into * @param len number of bytes to retrieve into given data array. @@ -300,8 +304,8 @@ * @brief * The numberOfBytesInCommBuffer function determines how many bytes are currently * contained in a given comm buffer. Both double buffers are considered for this. - * @details Inputs: activeDoubleBuffer[], commBufferByteCount[] - * @details Outputs: none + * @details \b Inputs: activeDoubleBuffer[], commBufferByteCount[] + * @details \b Outputs: none * @param buffer which comm buffer to get byte count for * @return the number of bytes in the given comm buffer. *************************************************************************/ @@ -330,8 +334,8 @@ * The switchDoubleBuffer function switches the active and inactive buffers for the * given buffer. This function should only be called when the current inactive buffer * has been emptied. Any unconsumed data in inactive buffer will be lost. - * @details Inputs: activeDoubleBuffer[] - * @details Outputs: activeDoubleBuffer[], commBufferByteCount[] + * @details \b Inputs: activeDoubleBuffer[] + * @details \b Outputs: activeDoubleBuffer[], commBufferByteCount[] * @param buffer which comm buffer to switch double buffers on * @return the new active buffer for the given buffer. *************************************************************************/ @@ -354,8 +358,8 @@ * The getDataFromInactiveBuffer function retrieves a given number of bytes * from the inactive buffer of a given buffer. This function should only be * called by getFromCommBuffer(). Params will be pre-validated there. - * @details Inputs: commBuffers[], activeDoubleBuffer[], commBufferByteCount[] - * @details Outputs: commBuffers[], activeDoubleBuffer[], commBufferByteCount[] + * @details \b Inputs: commBuffers[], activeDoubleBuffer[], commBufferByteCount[] + * @details \b Outputs: commBuffers[], activeDoubleBuffer[], commBufferByteCount[] * @param buffer which comm buffer get data from * @param data pointer to byte array to populate with data * @param len number of bytes to get from comm buffer Index: firmware/App/Services/FPGADD.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/FPGADD.c (.../FPGADD.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/FPGADD.c (.../FPGADD.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -305,8 +305,8 @@ /*********************************************************************//** * @brief * The initFPGADD function initializes the DD FPGA module. - * @details Inputs: none - * @details Outputs: FPGA module initialized. + * @details \b Inputs: none + * @details \b Outputs: FPGA module initialized. * @return none *************************************************************************/ void initFPGADD( void ) @@ -336,8 +336,10 @@ /*********************************************************************//** * @brief * The execFPGATest function executes the FPGA self-test. - * @details Inputs: fpgaHeader - * @details Outputs: none + * @details \b Inputs: fpgaHeader + * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_FPGA_POST_TEST_FAILED when FPGA compatibility failed and/or + * wrong FPGA header seen. * @return passed, or failed *************************************************************************/ SELF_TEST_STATUS_T execFPGATest( void ) @@ -355,13 +357,13 @@ else { result = SELF_TEST_STATUS_FAILED; - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_FPGA_POST_TEST_FAILED, (U32)DG_FPGA_COMPATIBILITY_REV, (U32)fpgaSensorReadings.fpgaCompatibilityRev ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)DD_FPGA_COMPATIBILITY_REV, (U32)fpgaSensorReadings.fpgaCompatibilityRev ) } } else { result = SELF_TEST_STATUS_FAILED; - //SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DG_FPGA_POST_TEST_FAILED, (U32)fpgaHeader.fpgaId ) + SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_FPGA_POST_TEST_FAILED, (U32)fpgaHeader.fpgaId ) } return result; @@ -371,9 +373,11 @@ * @brief * The execFPGAClockSpeedTest function verifies the processor clock speed * against the FPGA clock. - * @details Inputs: fpgaHeader, + * @details \b Inputs: fpgaHeader, * window timer TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR - * @details Outputs: none + * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_FPGA_CLOCK_SPEED_CHECK_FAILURE when clock speed + * mismatch seen. * @return: none *************************************************************************/ void execFPGAClockSpeedTest( void ) @@ -398,7 +402,7 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_CLOCK_SPEED_ERROR ) ) { - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_CLOCK_SPEED_CHECK_FAILURE, diffFPGATimerCount, diffTimerCount ); } } } @@ -425,8 +429,8 @@ * 10..11 - reserved (spare).\n * 12- VPd.\n * 13..15 - reserved or unused. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaValveStates + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaValveStates * @param valveStates bit mask for the various valve states * @return none *************************************************************************/ @@ -439,8 +443,8 @@ * @brief * The setFPGADrainPumpSpeed function sets the drain pump target speed. * The drain pump DAC value should be set to 1 count for each 12.94 RPM desired. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaDrainPumpSetSpeed + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaDrainPumpSetSpeed * @param drainPumpDAC DAC value to command for the drain pump * @return none *************************************************************************/ @@ -456,8 +460,8 @@ * @brief * The setFPGACPoProbeType function sets the CPo sensor probe type and * sets the control register to write probe type to the device. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCPoProbeType, fpgaActuatorSetPoints.fpgaCPoControlReg + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPoProbeType, fpgaActuatorSetPoints.fpgaCPoControlReg * @param probeType The probe cell constant value to set to * @return none *************************************************************************/ @@ -471,8 +475,8 @@ * @brief * The setFPGACPiProbeType function sets the CPi sensor probe type and * sets the control register to write probe type to the device. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCPiProbeType, fpgaActuatorSetPoints.fpgaCPiControlReg + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCPiProbeType, fpgaActuatorSetPoints.fpgaCPiControlReg * @param probeType The probe cell constant value to set to * @return none *************************************************************************/ @@ -486,8 +490,8 @@ * @brief * The setFPGAcidPumpControl function sets the control configuration for * concentrate pump CP1. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCP1Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCP1Control * @param pumpControl The concentrate pump control configuration * @return none *************************************************************************/ @@ -501,8 +505,8 @@ * @brief * The setFPGABicarbPumpControl function sets the control configuration for * concentrate pump CP2. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCP2Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCP2Control * @param pumpControl The concentrate pump control configuration * @return none *************************************************************************/ @@ -516,8 +520,8 @@ * @brief * The setFPGABicarbPumpControl function sets the park command bit for the * concentrate pump CP1. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCP1Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCP1Control * @return none *************************************************************************/ void setFPGAV3AcidPumpParkCmd( void ) @@ -529,8 +533,8 @@ * @brief * The setFPGAV3BicarbPumpParkCmd function sets the park command bit for the * concentrate pump CP2. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCP2Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCP2Control * @return none *************************************************************************/ void setFPGAV3BicarbPumpParkCmd( void ) @@ -542,8 +546,8 @@ * @brief * The setFPGAAcidPumpSetStepSpeed function sets the step speed period for * concentrate pump CP1. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCP1StepSpeed + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCP1StepSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ @@ -556,8 +560,8 @@ * @brief * The setFPGABicarbSetStepSpeed function sets the step speed period for * concentrate pump CP2. - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaCP2StepSpeed + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaCP2StepSpeed * @param stepSpeed The concentrate pump step speed period * @return none *************************************************************************/ @@ -576,8 +580,8 @@ * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control * @param control Concentrate pump control set * @return none *************************************************************************/ @@ -597,8 +601,8 @@ * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control * @return Acid pump control status bit *************************************************************************/ U08 getFPGAAcidPumpControlStatus( void ) @@ -616,8 +620,8 @@ * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control * @param control Concentrate pump control set * @return none *************************************************************************/ @@ -637,8 +641,8 @@ * bit 4: nEnable * bit 3: Direction (1=Fwd, 0=Rev) * bit 0-2: Microstepping resolution - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control * @return Bicarb pump control status bit *************************************************************************/ U08 getFPGABicarbPumpControlStatus( void ) @@ -652,8 +656,8 @@ * (acid pump) park command bit. * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaNewCP1Control * @param Park command bit set * @return none *************************************************************************/ @@ -668,8 +672,8 @@ * (bicarb pump) park command bit. * bit 7: Park command bit * bit 0-6: Other pump control bits (set in different function) - * @details Inputs: none - * @details Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control + * @details \b Inputs: none + * @details \b Outputs: fpgaActuatorSetPoints.fpgaNewCP2Control * @param Park command bit set * @return none *************************************************************************/ @@ -681,8 +685,8 @@ /*********************************************************************//** * @brief * The getFPGAVersions function gets the FPGA version numbers. - * @details Inputs: fpgaHeader - * @details Outputs: none + * @details \b Inputs: fpgaHeader + * @details \b Outputs: none * @return none *************************************************************************/ void getFPGAVersions( U08 *Id, U08 *Maj, U08 *Min, U08 *Lab ) @@ -698,8 +702,8 @@ * The getFPGALoadCellA1 function gets the latest load cell A 1 reading. * Least significant 24 bits are the reading. Most significant bit indicates * CRC or status error. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return last load cell A 1 reading *************************************************************************/ U32 getFPGALoadCellA1( void ) @@ -712,8 +716,8 @@ * The getFPGALoadCellA2 function gets the latest load cell A 2 reading. * Least significant 24 bits are the reading. Most significant bit indicates * CRC or status error. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return last load cell A 2 reading *************************************************************************/ U32 getFPGALoadCellA2( void ) @@ -726,8 +730,8 @@ * The getFPGALoadCellB1 function gets the latest load cell B 1 reading. * Least significant 24 bits are the reading. Most significant bit indicates * CRC or status error. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return last load cell B 1 reading *************************************************************************/ U32 getFPGALoadCellB1( void ) @@ -740,8 +744,8 @@ * The getFPGALoadCellB2 function gets the latest load cell B 2 reading. * Least significant 24 bits are the reading. Most significant bit indicates * CRC or status error. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return last load cell B 2 reading *************************************************************************/ U32 getFPGALoadCellB2( void ) @@ -753,8 +757,8 @@ * @brief * The getFPGAValveStates function gets the latest sensed valve states. * See setFPGAValveStates for valve state bit positions. - * @details Inputs: fpgaSensorReadings.fpgaValveStates - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaValveStates + * @details \b Outputs: none * @return last valve states reading *************************************************************************/ U16 getFPGAValveStates( void ) @@ -765,8 +769,8 @@ /*********************************************************************//** * @brief * The getFPGAROPumpFlowRate function gets the latest RO flow rate. - * @details Inputs: fpgaSensorReadings.fpgaROFlowRate - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaROFlowRate + * @details \b Outputs: none * @return last RO flow rate reading *************************************************************************/ U16 getFPGAROPumpFlowRate( void ) @@ -777,8 +781,8 @@ /*********************************************************************//** * @brief * The getFPGADialysateFlowRate function gets the latest dialysate flow rate. - * @details Inputs: fpgaSensorReadings.fpgaDialysateFlowRate - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaDialysateFlowRate + * @details \b Outputs: none * @return last dialysate flow rate reading *************************************************************************/ U16 getFPGADialysateFlowRate( void ) @@ -789,8 +793,8 @@ /*********************************************************************//** * @brief * The getFPGADrainPumpSpeed function gets the latest sensed drain pump speed. - * @details Inputs: fpgaSensorReadings.fpgaDrainPumpSpeed - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaDrainPumpSpeed + * @details \b Outputs: none * @return last drain pump speed reading *************************************************************************/ U16 getFPGADrainPumpSpeed( void ) @@ -801,8 +805,8 @@ /*********************************************************************//** * @brief * The getFPGATPiTemp function gets the latest primary heater inlet temperature reading. - * @details Inputs: fpgaSensorReadings.fpgaTPiTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTPiTemp + * @details \b Outputs: none * @return last primary heater inlet temperature reading *************************************************************************/ U32 getFPGATPiTemp( void ) @@ -813,8 +817,8 @@ /*********************************************************************//** * @brief * The getFPGATPoTemp function gets the latest primary heater outlet temperature reading. - * @details Inputs: fpgaSensorReadings.fpgaTPoTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTPoTemp + * @details \b Outputs: none * @return last primary heater outlet temperature reading *************************************************************************/ U32 getFPGATPoTemp( void ) @@ -826,8 +830,8 @@ * @brief * The getFPGATD1Temp function gets the latest conductivity sensor 1 * temperature reading in ADC. - * @details Inputs: fpgaSensorReadings.fpgaCD1Temp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCD1Temp + * @details \b Outputs: none * @return last conductivity sensor 1 outlet temperature reading *************************************************************************/ U32 getFPGACD1Temp( void ) @@ -839,8 +843,8 @@ * @brief * The getFPGATD2Temp function gets the latest conductivity sensor 2 * temperature reading in ADC. - * @details Inputs: fpgaSensorReadings.fpgaCD2Temp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCD2Temp + * @details \b Outputs: none * @return last conductivity sensor 2 outlet temperature reading *************************************************************************/ U32 getFPGACD2Temp( void ) @@ -852,8 +856,8 @@ * @brief * The getFPGARTDErrorCount function gets error count of the RTD. It covers * all the four temperature sensors associates with conductivity sensors. - * @details Inputs: fpgaSensorReadings.fpgaRTDErrorCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaRTDErrorCnt + * @details \b Outputs: none * @return Last error count of the RTD temperature sensors *************************************************************************/ U08 getFPGARTDErrorCount( void ) @@ -866,8 +870,8 @@ * The getFPGARTDReadCount function gets the read count of the RTD * temperature sensors. It covers all the four temperature sensors associates * with conductivity sensors. - * @details Inputs: fpgaSensorReadings.fpgaRTDReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaRTDReadCnt + * @details \b Outputs: none * @return Last read count of the RTC temperature sensors *************************************************************************/ U08 getFPGARTDReadCount( void ) @@ -879,8 +883,8 @@ * @brief * The getFPGATRoTemp function gets the latest redundant sensor outlet * temperature reading in ADC. - * @details Inputs: fpgaSensorReadings.fpgaTRo - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTRo + * @details \b Outputs: none * @return Last redundant sensor outlet temperature reading *************************************************************************/ U32 getFPGATRoTemp( void ) @@ -891,8 +895,8 @@ /*********************************************************************//** * @brief * The getFPGATRoErrorCount gets the error count of the THDo (redundant) temperature sensor. - * @details Inputs: fpgaSensorReadings.fpgaTRoErrorCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTRoErrorCnt + * @details \b Outputs: none * @return Last redundant sensor outlet temperature error count *************************************************************************/ U08 getFPGATRoErrorCount( void ) @@ -903,8 +907,8 @@ /*********************************************************************//** * @brief * The getFPGATRoReadCount gets the read count of the THDo (redundant) temperature sensor. - * @details Inputs: fpgaSensorReadings.fpgaTRoReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTRoReadCnt + * @details \b Outputs: none * @return Last redundant sensor outlet temperature error count reading *************************************************************************/ U08 getFPGATRoReadCount( void ) @@ -915,8 +919,8 @@ /*********************************************************************//** * @brief * The getFPGATDiTemp function gets the latest dialysate inlet temperature reading in ADC. - * @details Inputs: fpgaSensorReadings.fpgaTDiTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTDiTemp + * @details \b Outputs: none * @return last primary heater outlet temperature reading *************************************************************************/ U32 getFPGATDiTemp( void ) @@ -927,8 +931,8 @@ /*********************************************************************//** * @brief * The getFPGATDiErrorCount function gets the latest dialysate inlet temperature error count. - * @details Inputs: fpgaSensorReadings.fpgaTDiErrorCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTDiErrorCnt + * @details \b Outputs: none * @return Last dialysate inlet error count *************************************************************************/ U08 getFPGATDiErrorCount( void ) @@ -939,8 +943,8 @@ /*********************************************************************//** * @brief * The getFPGATDiReadCount function gets the latest dialysate inlet temperature read count. - * @details Inputs: fpgaSensorReadings.fpgaTDiReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTDiReadCnt + * @details \b Outputs: none * @return Last dialysate inlet read count *************************************************************************/ U08 getFPGATDiReadCount( void ) @@ -952,8 +956,8 @@ * @brief * The getFPGAPrimaryHeaterTemp function gets the latest primary heater * internal temperature reading. - * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterIntTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaPrimaryHeaterIntTemp + * @details \b Outputs: none * @return last primary heater temperature reading *************************************************************************/ U16 getFPGAPrimaryHeaterTemp( void ) @@ -965,8 +969,8 @@ * @brief * The getFPGAPrimaryHeaterFlags function gets the latest primary heater * internal temperature sensor flags read. - * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterFlags - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaPrimaryHeaterFlags + * @details \b Outputs: none * @return Last primary heater internal temperature sensor flag read *************************************************************************/ U08 getFPGAPrimaryHeaterFlags( void ) @@ -978,8 +982,8 @@ * @brief * The geetFPGAPrimaryHeaterReadCount function gets the latest primary heater * internal temperature sensor read count. - * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaPrimaryHeaterReadCnt + * @details \b Outputs: none * @return Last primary heater internal temperature sensor read count *************************************************************************/ U08 getFPGAPrimaryHeaterReadCount( void ) @@ -991,8 +995,8 @@ * @brief * The getFPGATrimmerHeaterTemp function gets the latest trimmer heater * internal temperature sensor reading. - * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterIntTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTrimmerHeaterIntTemp + * @details \b Outputs: none * @return last trimmer heater temperature reading *************************************************************************/ U16 getFPGATrimmerHeaterTemp( void ) @@ -1004,8 +1008,8 @@ * @brief * The getFPGATrimmerHeaterFlags function gets the latest trimmer heater * internal temperature flags read. - * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterFlags - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTrimmerHeaterFlags + * @details \b Outputs: none * @return Last trimmer heater internal temperature flags read *************************************************************************/ U08 getFPGATrimmerHeaterFlags( void ) @@ -1017,8 +1021,8 @@ * @brief * The getFPGATrimmerHeaterReadCount function gets the latest trimmer heater * internal temperature read count. - * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTrimmerHeaterReadCnt + * @details \b Outputs: none * @return Last trimmer heater internal temperature read count *************************************************************************/ U08 getFPGATrimmerHeaterReadCount( void ) @@ -1029,8 +1033,8 @@ /*********************************************************************//** * @brief * The getFPGAPrimaryColdJunctionTemp function gets primary cold junction temperature. - * @details Inputs: fpgaSensorReadings.fpgaPrimaryHeaterIntJunctionTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaPrimaryHeaterIntJunctionTemp + * @details \b Outputs: none * @return Last primary cold junction temperature *************************************************************************/ U16 getFPGAPrimaryColdJunctionTemp( void ) @@ -1041,8 +1045,8 @@ /*********************************************************************//** * @brief * The getFPGATrimmerColdJunctionTemp function gets trimmer cold junction temperature. - * @details Inputs: fpgaSensorReadings.fpgaTrimmerHeaterIntJunctionTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTrimmerHeaterIntJunctionTemp + * @details \b Outputs: none * @return Last trimmer cold junction temperature *************************************************************************/ U16 getFPGATrimmerColdJunctionTemp( void ) @@ -1054,8 +1058,8 @@ * @brief * The getFPGAAccelAxes function gets the accelerometer axis readings. * Axis readings are in ADC counts. 0.004 g per LSB. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @param x Populate this param with X axis reading * @param y Populate this param with Y axis reading * @param z Populate this param with Z axis reading @@ -1072,8 +1076,8 @@ * @brief * The getFPGAAccelMaxes function gets the maximum accelerometer axis readings from * last FPGA read (every 10 ms). Axis readings are in ADC counts. 0.004 g per LSB. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @param x Populate this param with maximum X axis reading * @param y Populate this param with maximum Y axis reading * @param z Populate this param with maximum Z axis reading @@ -1090,8 +1094,8 @@ * @brief * The getFPGAAccelStatus function gets the accelerometer reading count * and error register values. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @param cnt Populate this param with latest sample counter value * @param err Populate this param with latest error * @return none @@ -1105,8 +1109,8 @@ /*********************************************************************//** * @brief * The getFPGACPiFault function gets CPi conductivity sensor fault. - * @details Inputs: fpgaSensorReadings.fpgaCPiFault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPiFault + * @details \b Outputs: none * @return Latest CPi conductivity sensor fault *************************************************************************/ U08 getFPGACPiFault( void ) @@ -1117,8 +1121,8 @@ /*********************************************************************//** * @brief * The getFPGACPiReadCount function gets CPi conductivity sensor read count. - * @details Inputs: fpgaSensorReadings.fpgaCPiReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPiReadCnt + * @details \b Outputs: none * @return Latest CPi conductivity sensor read count *************************************************************************/ U08 getFPGACPiReadCount( void ) @@ -1129,8 +1133,8 @@ /*********************************************************************//** * @brief * The getFPGACPiErrorCount function gets CPi conductivity sensor error count. - * @details Inputs: fpgaSensorReadings.fpgaCPiErrorCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPiErrorCnt + * @details \b Outputs: none * @return Latest CPi conductivity sensor read error count *************************************************************************/ U08 getFPGACPiErrorCount( void ) @@ -1141,8 +1145,8 @@ /*********************************************************************//** * @brief * The getFPGACPi function gets CPi conductivity sensor value. - * @details Inputs: fpgaSensorReadings.fpgaCPi - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPi + * @details \b Outputs: none * @return Latest CPi conductivity sensor value *************************************************************************/ U32 getFPGACPi( void ) @@ -1153,8 +1157,8 @@ /*********************************************************************//** * @brief * The getFPGACPoFault function gets CPo conductivity sensor fault. - * @details Inputs: fpgaSensorReadings.fpgaCPoFault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPoFault + * @details \b Outputs: none * @return Latest CPo sensor fault *************************************************************************/ U08 getFPGACPoFault( void ) @@ -1165,8 +1169,8 @@ /*********************************************************************//** * @brief * The getFPGACPoReadCount function gets CPo conductivity sensor read count. - * @details Inputs: fpgaSensorReadings.fpgaCPoReadCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPoReadCnt + * @details \b Outputs: none * @return Latest CPo conductivity sensor read count *************************************************************************/ U08 getFPGACPoReadCount( void ) @@ -1178,8 +1182,8 @@ * @brief * The getFPGACPoErrorCount function gets CPo conductivity sensor error count. * error count - * @details Inputs: fpgaSensorReadings.fpgaCPoErrorCnt - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPoErrorCnt + * @details \b Outputs: none * @return Latest CPo conductivity sensor read error count *************************************************************************/ U08 getFPGACPoErrorCount( void ) @@ -1190,8 +1194,8 @@ /*********************************************************************//** * @brief * The getFPGACPo function gets CPo conductivity sensor value. - * @details Inputs: fpgaSensorReadings.fpgaCPo - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPo + * @details \b Outputs: none * @return Latest CPo conductivity sensor value *************************************************************************/ U32 getFPGACPo( void ) @@ -1203,8 +1207,8 @@ * @brief * The getFPGAConcentratePumpsFault function gets concentrate pumps fault * reported by FGPA. - * @details Inputs: fpgaSensorReadings.fpgaCP1CP2Fault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP1CP2Fault + * @details \b Outputs: none * @return Latest concentrate pumps fault value *************************************************************************/ U08 getFPGAConcentratePumpsFault( void ) @@ -1216,8 +1220,8 @@ * @brief * The getFPGAAcidPumpIsParked function gets whether the acid pump is currently * parked. - * @details Inputs: fpgaSensorReadings.fpgaCP1CP2Fault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP1CP2Fault + * @details \b Outputs: none * @return TRUE if acid pump is parked, FALSE if not *************************************************************************/ BOOL getFPGAAcidPumpIsParked( void ) @@ -1232,8 +1236,8 @@ * @brief * The getFPGABicarbPumpIsParked function gets whether the bicarb pump is currently * parked. - * @details Inputs: fpgaSensorReadings.fpgaCP1CP2Fault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP1CP2Fault + * @details \b Outputs: none * @return TRUE if bicarb pump is parked, FALSE if not *************************************************************************/ BOOL getFPGABicarbPumpIsParked( void ) @@ -1248,8 +1252,8 @@ * @brief * The getFPGAAcidPumpParkFault function gets whether the acid pump park command * has faulted. - * @details Inputs: fpgaSensorReadings.fpgaCP1CP2Fault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP1CP2Fault + * @details \b Outputs: none * @return TRUE if acid pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGAAcidPumpParkFault( void ) @@ -1264,8 +1268,8 @@ * @brief * The getFPGABicarbPumpParkFault function gets whether the bicarb pump park command * has faulted. - * @details Inputs: fpgaSensorReadings.fpgaCP1CP2Fault - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP1CP2Fault + * @details \b Outputs: none * @return TRUE if bicarb pump park command faulted, FALSE if not *************************************************************************/ BOOL getFPGABicarbPumpParkFault( void ) @@ -1279,8 +1283,8 @@ /*********************************************************************//** * @brief * The getFPGAEmstatOutByte function gets Emstat conductivity sensor output byte. - * @details Inputs: fpgaSensorReadings.fpgaEmstatOutByte - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaEmstatOutByte + * @details \b Outputs: none * @return Emstat conductivity sensor output byte *************************************************************************/ U08 getFPGAEmstatCD1CD2OutByte( void ) @@ -1292,8 +1296,8 @@ * @brief * The getFPGAEmstatCD1CD2RxErrCount function gets Emstat conductivity sensor * error count. - * @details Inputs: fpgaSensorReadings.fpgaEmstatRxErrorCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaEmstatRxErrorCount + * @details \b Outputs: none * @return Emstat conductivity sensor receive error count *************************************************************************/ U08 getFPGAEmstatCD1CD2RxErrCount( void ) @@ -1305,8 +1309,8 @@ * @brief * The getFPGAEmstatCD1CD2RxFifoCount function gets Emstat conductivity * sensor receive fifo buffer count. - * @details Inputs: fpgaSensorReadings.fpgaEmstatTxFifoCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaEmstatTxFifoCount + * @details \b Outputs: none * @return Emstat conductivity sensor receive fifo buffer count *************************************************************************/ U16 getFPGAEmstatCD1CD2RxFifoCount( void ) @@ -1318,8 +1322,8 @@ * @brief * The getFPGACP1HallSensePulseWidth function gets concentrate pump CP1 * hall sense pulse width. - * @details Inputs: fpgaSensorReadings.fpgaCP1HallSense - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP1HallSense + * @details \b Outputs: none * @return concentrate pump CP1 hall sense pulse width *************************************************************************/ U16 getFPGACP1HallSensePulseWidth( void ) @@ -1331,8 +1335,8 @@ * @brief * The getFPGACP1HallSensePulseWidth function gets concentrate pump CP2 * hall sense pulse width. - * @details Inputs: fpgaSensorReadings.fpgaCP2HallSense - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCP2HallSense + * @details \b Outputs: none * @return concentrate pump CP2 hall sense pulse width *************************************************************************/ U16 getFPGACP2HallSensePulseWidth( void ) @@ -1343,8 +1347,8 @@ /*********************************************************************//** * @brief * The getFPGAFan1Pulse function gets inlet fan 1 pulse value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return inlet fan 1 pulse value *************************************************************************/ U16 getFPGAInletFan1TogglePeriod( void ) @@ -1355,8 +1359,8 @@ /*********************************************************************//** * @brief * The getFPGAFan2Pulse function gets inlet fan 2 pulse value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return inlet fan 2 pulse value *************************************************************************/ U16 getFPGAInletFan2TogglePeriod( void ) @@ -1367,8 +1371,8 @@ /*********************************************************************//** * @brief * The getFPGAInletFan3Pulse function gets inlet fan 3 pulse value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return inlet fan 3 pulse value *************************************************************************/ U16 getFPGAInletFan3TogglePeriod( void ) @@ -1379,8 +1383,8 @@ /*********************************************************************//** * @brief * The getFPGAOutletFan1Pulse function gets outlet fan 1 pulse value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return outlet fan 1 pulse value *************************************************************************/ U16 getFPGAOutletFan1TogglePeriod( void ) @@ -1391,8 +1395,8 @@ /*********************************************************************//** * @brief * The getFPGAOutletFan2Pulse function gets outlet fan 2 pulse value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return outlet fan 2 pulse value *************************************************************************/ U16 getFPGAOutletFan2TogglePeriod( void ) @@ -1403,8 +1407,8 @@ /*********************************************************************//** * @brief * The getFPGAOutletFan3Pulse function gets outlet fan 3 pulse value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return outlet fan 3 pulse value *************************************************************************/ U16 getFPGAOutletFan3TogglePeriod( void ) @@ -1415,8 +1419,8 @@ /*********************************************************************//** * @brief * The getFPGABoardTemp function gets FPGA board temperature reading. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return FPGA board temperature reading in ADC counts *************************************************************************/ U16 getFPGABoardTemp( void ) @@ -1427,8 +1431,8 @@ /*********************************************************************//** * @brief * The getFPGAA1B1Temp function gets load cells A1/B1 temperature reading. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return load cells A1/B1 temperature reading in ADC counts *************************************************************************/ U32 getFPGALoadCellsA1B1Temp( void ) @@ -1439,8 +1443,8 @@ /*********************************************************************//** * @brief * The getFPGAA1B1Temp function gets load cells A2/B2 temperature reading. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return load cells A2/B2 temperature reading in ADC counts *************************************************************************/ U32 getFPGALoadCellsA2B2Temp( void ) @@ -1451,8 +1455,8 @@ /*********************************************************************//** * @brief * The getFPGATRoInternalTemp function gets TRo internal temperature reading. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return TRo internal temperature reading in ADC counts *************************************************************************/ U32 getFPGATRoInternalTemp( void ) @@ -1463,8 +1467,8 @@ /*********************************************************************//** * @brief * The getFPGATDiInternalTemp function gets TDi internal temperature reading. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return TDi internal temperature reading in ADC counts *************************************************************************/ U32 getFPGATDiInternalTemp( void ) @@ -1476,8 +1480,8 @@ * @brief * The getFPGAConductivitySnsrInternalTemp function gets conductivity sensor * internal temperature reading. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return conductivity sensor temperature reading in ADC counts *************************************************************************/ U32 getFPGACondSnsrInternalTemp( void ) @@ -1488,8 +1492,8 @@ /*********************************************************************//** * @brief * The getFPGAADC1ReadCount function gets the FPGA ADC1 read count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return FPGA ADC1 read count *************************************************************************/ U08 getFPGAADC1ReadCount( void ) @@ -1500,8 +1504,8 @@ /*********************************************************************//** * @brief * The getFPGAADC1ErrorCount function gets the FPGA ADC1 error count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return FPGA ADC1 error count *************************************************************************/ U08 getFPGAADC1ErrorCount( void ) @@ -1512,8 +1516,8 @@ /*********************************************************************//** * @brief * The getFPGAADC2ReadCount function gets the FPGA ADC2 read count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return FPGA ADC2 read count *************************************************************************/ U08 getFPGAADC2ReadCount( void ) @@ -1524,8 +1528,8 @@ /*********************************************************************//** * @brief * The getFPGAADC2ErrorCount function gets the FPGA ADC2 error count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return FPGA ADC2 error count *************************************************************************/ U08 getFPGAADC2ErrorCount( void ) @@ -1536,8 +1540,8 @@ /*********************************************************************//** * @brief * The getFPGATimerCount function gets the latest FPGA timer millisecond count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return last FPGA timer count *************************************************************************/ U16 getFPGATimerCount( void ) @@ -1549,8 +1553,8 @@ * @brief * The noFluidLeakDetected function returns TRUE if no fluid leak has been * detected (dry) and FALSE if a fluid leak has been detected (wet). - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return noFluidLeakDetected *************************************************************************/ BOOL noFPGAFluidLeakDetected( void ) @@ -1564,8 +1568,8 @@ * @brief * The getFPGADialysateCapStatus function gets the FPGA dialysate cap status * bit. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return dialysate cap status bit *************************************************************************/ U08 getFPGADialysateCapStatus( void ) @@ -1577,8 +1581,8 @@ * @brief * The getFPGAConcentrateCapStatus function gets the FPGA concentrate cap * status bit. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return concentrate cap status bit *************************************************************************/ U08 getFPGAConcentrateCapStatus( void ) @@ -1589,8 +1593,8 @@ /*********************************************************************//** * @brief * The getFPGAInternalVccVoltage function gets the FPGA internal Vcc voltage. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return internal Vcc voltage *************************************************************************/ U16 getFPGAInternalVccVoltage( void ) @@ -1602,8 +1606,8 @@ * @brief * The getFPGAInternalVccAuxilaryVoltage function gets the FPGA auxiliary * Vcc voltage. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return auxiliary Vcc voltage *************************************************************************/ U16 getFPGAInternalVccAuxiliaryVoltage( void ) @@ -1614,8 +1618,8 @@ /*********************************************************************//** * @brief * The getFPGAVPVNVoltage function gets the FPGA VPVN voltage. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return VPVN voltage *************************************************************************/ U16 getFPGAVPVNVoltage( void ) @@ -1628,8 +1632,8 @@ * @brief * The getHardwareConfigStatus function returns the status of the hardware * configuration. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return status of the hardware configuration *************************************************************************/ //HARDWARE_CONFIG_T getHardwareConfigStatus( void ) @@ -1643,8 +1647,8 @@ /*********************************************************************//** * @brief * The getFPGABaroReadCount function gets the FPGA barometric sensor read count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor read count *************************************************************************/ U08 getFPGABaroReadCount( void ) @@ -1655,8 +1659,8 @@ /*********************************************************************//** * @brief * The getFPGABaroErrorCount function gets the FPGA barometric sensor error count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor error count *************************************************************************/ U08 getFPGABaroErrorCount( void ) @@ -1668,8 +1672,8 @@ * @brief * The getFPGABaroMfgInfo function gets the FPGA barometric pressure * sensor manufacturing information. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor manufacturing information *************************************************************************/ U16 getFPGABaroMfgInfo( void ) @@ -1681,8 +1685,8 @@ * @brief * The getFPGABaroPressureSensitivity function gets the FPGA barometric pressure * sensor sensitivity. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor sensitivity *************************************************************************/ U16 getFPGABaroPressureSensitivity( void ) @@ -1694,8 +1698,8 @@ * @brief * The getFPGABaroPressureOffset function gets the FPGA barometric pressure * sensor offset. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor offset *************************************************************************/ U16 getFPGABaroPressureOffset( void ) @@ -1707,8 +1711,8 @@ * @brief * The getFPGABaroTempCoeffOfPressSensitvity function gets the FPGA barometric * pressure sensor temperature coefficient of pressure sensitivity. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor temperature coefficient of pressure sensitivity *************************************************************************/ U16 getFPGABaroTempCoeffOfPressSensitvity( void ) @@ -1720,8 +1724,8 @@ * @brief * The getFPGABaroTempCoeffOfPressOffset function gets the FPGA barometric * pressure sensor temperature coefficient of pressure offset. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor temperature coefficient of pressure offset *************************************************************************/ U16 getFPGABaroTempCoeffOfPressOffset( void ) @@ -1733,8 +1737,8 @@ * @brief * The getFPGABaroReferenceTemperature function gets the FPGA barometric pressure * sensor reference temperature. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor reference temperature *************************************************************************/ U16 getFPGABaroReferenceTemperature( void ) @@ -1746,8 +1750,8 @@ * @brief * The getFPGABaroTempCoeffOfTemperature function gets the FPGA barometric pressure * sensor temperature coefficient of temperature. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor temperature coefficient of temperature *************************************************************************/ U16 getFPGABaroTempCoeffOfTemperature( void ) @@ -1759,8 +1763,8 @@ * @brief * The getFPGABaroCoeffsCRC function gets the FPGA barometric pressure * sensor temperature coefficients' CRC. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor temperature coefficients' CRC *************************************************************************/ U16 getFPGABaroCoeffsCRC( void ) @@ -1772,8 +1776,8 @@ * @brief * The getFPGABaroPressure function gets the FPGA barometric pressure sensor * pressure. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor pressure *************************************************************************/ U32 getFPGABaroPressure( void ) @@ -1785,8 +1789,8 @@ * @brief * The getFPGABaroTemperature function gets the FPGA barometric pressure sensor * temperature. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return barometric pressure sensor temperature *************************************************************************/ U32 getFPGABaroTemperature( void ) @@ -1798,8 +1802,8 @@ * @brief * The getFPGAEmstatCPiCPoByteOut function gets the FPGA Emstat CPi/CPo * byte out data. - * @details Inputs: fpgaSensorReadings.fpgaCPiCPoEmstatOutByte - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCPiCPoEmstatOutByte + * @details \b Outputs: none * @return CPi/CPo Emstat byte out *************************************************************************/ U08 getFPGAEmstatCPiCPoByteOut( void ) @@ -1811,8 +1815,8 @@ * @brief * The getFPGAEmstatCPiCPoRxFifoCount function gets the FPGA Emstat CPi/CPo * receive FIFO count. - * @details Inputs: fpgaSensorReadings.fpgaCD1CD2EmstatRxFifoCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCD1CD2EmstatRxFifoCount + * @details \b Outputs: none * @return CPi/CPo Rx FIFO count *************************************************************************/ U16 getFPGAEmstatCPiCPoRxFifoCount( void ) @@ -1824,8 +1828,8 @@ * @brief * The getFPGAEmstatCPiCPoRxErrCount function gets the FPGA Emstat CPi/CPo * receive FIFO error count. - * @details Inputs: fpgaSensorReadings.fpgaCD1CD2EmstatRxErrorCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaCD1CD2EmstatRxErrorCount + * @details \b Outputs: none * @return CPi/CPo Rx FIFO error count *************************************************************************/ U08 getFPGAEmstatCPiCPoRxErrCount( void ) @@ -1836,8 +1840,8 @@ /*********************************************************************//** * @brief * The getFPGATHdTemp function gets the FPGA THd temperature sensor. - * @details Inputs: fpgaSensorReadings.fpgaTHdTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTHdTemp + * @details \b Outputs: none * @return THd temperature sensor *************************************************************************/ U32 getFPGATHdTemp( void ) @@ -1848,8 +1852,8 @@ /*********************************************************************//** * @brief * The getFPGATHdInternalTemp function gets the FPGA THd internal ADC temperature sensor. - * @details Inputs: fpgaSensorReadings.fpgaTHdInternalTemp - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTHdInternalTemp + * @details \b Outputs: none * @return THd internal ADC temperature sensor *************************************************************************/ U32 getFPGATHdInternalTemp( void ) @@ -1861,8 +1865,8 @@ * @brief * The getFPGATHdReadCount function gets the FPGA THd temperature sensor read * count. - * @details Inputs: fpgaSensorReadings.fpgaTHdRTDReadCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTHdRTDReadCount + * @details \b Outputs: none * @return THd FPGA read count *************************************************************************/ U08 getFPGATHdReadCount( void ) @@ -1874,8 +1878,8 @@ * @brief * The getFPGATHdErrorCount function gets the FPGA THd temperature sensor error * count. - * @details Inputs: fpgaSensorReadings.fpgaTHdRTDErrorCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaTHdRTDErrorCount + * @details \b Outputs: none * @return THd FPGA error count *************************************************************************/ U08 getFPGATHdErrorCount( void ) @@ -1887,8 +1891,8 @@ * @brief * The getFPGAROFlowSensorEdgeCount function gets the FPGA RO flow sensor * edge count. - * @details Inputs: fpgaSensorReadings.fpgaROFlowSensorEdgeCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaROFlowSensorEdgeCount + * @details \b Outputs: none * @return RO flow sensor edge count *************************************************************************/ U16 getFPGAROFlowSensorEdgeCount( void ) @@ -1900,8 +1904,8 @@ * @brief * The getFPGADialysateFlowSensorEdgeCount function gets the FPGA dialysate * flow sensor edge count - * @details Inputs: fpgaSensorReadings.fpgaDialysateFlowSensorEdgeCount - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings.fpgaDialysateFlowSensorEdgeCount + * @details \b Outputs: none * @return Dialysate flow sensor edge count *************************************************************************/ U16 getFPGADialysateFlowSensorEdgeCount( void ) @@ -1912,8 +1916,8 @@ /*********************************************************************//** * @brief * The getFPGAHeaterGateADC function gets Heater Gate ADC value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return heater gate adc value *************************************************************************/ U16 getFPGAHeaterGateADC( void ) @@ -1924,8 +1928,8 @@ /*********************************************************************//** * @brief * The getFPGAHeaterGndADC function gets Heater Ground ADC value. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return heater ground adc value *************************************************************************/ U16 getFPGAHeaterGndADC( void ) @@ -1937,8 +1941,8 @@ * @brief * The getFPGAHeaterGateADCReadCount function returns the main primary heater * voltage ADC read count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return main primary heater voltage ADC read count *************************************************************************/ U08 getFPGAHeaterGateADCReadCount( void ) @@ -1950,8 +1954,8 @@ * @brief * The getFPGAHeaterGateADCReadCount function returns the main primary heater * voltage ADC error count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return main primary heater voltage ADC error count *************************************************************************/ U08 getFPGAHeaterGateADCErrorCount( void ) @@ -1963,8 +1967,8 @@ * @brief * The getFPGADrainPumpCurrentFeedback function returns the drain pump current * feedback. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return drain pump current feedback *************************************************************************/ U16 getFPGADrainPumpCurrentFeedback( void ) @@ -1976,8 +1980,8 @@ * @brief * The getFPGADrainPumpSpeedFeedback function returns the drain pump speed * feedback. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return drain pump speed feedback *************************************************************************/ U16 getFPGADrainPumpSpeedFeedback( void ) @@ -1988,8 +1992,8 @@ /*********************************************************************//** * @brief * The getFPGADrainPumpDirection function returns the drain pump direction. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return drain pump direction *************************************************************************/ U08 getFPGADrainPumpDirection( void ) @@ -2001,8 +2005,8 @@ * @brief * The getFPGAOnBoardThermistorCount function returns the onboard thermistor * count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return onboard thermistor *************************************************************************/ U16 getFPGAOnBoardThermistorCount( void ) @@ -2015,8 +2019,8 @@ * The getFPGAPowerSupply2ThermistorCount function returns the * Power Supply 2 thermistor * count. - * @details Inputs: fpgaSensorReadings - * @details Outputs: none + * @details \b Inputs: fpgaSensorReadings + * @details \b Outputs: none * @return onboard thermistor *************************************************************************/ U16 getFPGAPowerSupply2ThermistorCount( void ) @@ -2029,8 +2033,8 @@ * The checkFPGACommFailure function increments the FPGA comm failure * windowed timer and returns whether or not the number of failures in * the window have been reached. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return TRUE if windowed count exceeded, else false. *************************************************************************/ void checkFPGACommFailure( void ) @@ -2039,7 +2043,7 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) } } } @@ -2050,8 +2054,8 @@ * windowed timer if an FE or OE error has occurred and returns whether * or not the number of failures in * the window have been reached. - * @details Inputs: none - * @details Outputs: none + * @details \b Inputs: none + * @details \b Outputs: none * @return TRUE if windowed count exceeded, else false. *************************************************************************/ BOOL checkFPGAFEOEFailure( void ) @@ -2065,7 +2069,7 @@ { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_FPGA_COMM_FAILURES ) ) { - //SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DG_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) + SET_ALARM_WITH_2_U32_DATA( ALARM_ID_DD_FPGA_COMM_TIMEOUT, MAX_FPGA_COMM_FAILURES, (U32)fpgaSensorReadings.fpgaIOErrorCntProcessor ) status = TRUE; } } Index: firmware/App/Services/Interrupts.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/Interrupts.c (.../Interrupts.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -52,8 +52,8 @@ /*********************************************************************//** * @brief * The initInterrupts function initializes the Interrupts module. - * @details Inputs: none - * @details Outputs: Interrupts module initialized + * @details \b Inputs: none + * @details \b Outputs: Interrupts module initialized * @return none *************************************************************************/ void initInterrupts( void ) @@ -69,9 +69,10 @@ /*********************************************************************//** * @brief - * The phantomInterrupt function handles phantom interrupts. - * @details Inputs: none - * @details Outputs: phantom interrupt handled + * The phantomInterrupt function handles spurious Interrupts. + * @details \b Inputs: none + * @details \b Outputs: phantom interrupt handled + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when spurious interrupts handled * @return none *************************************************************************/ void phantomInterrupt( void ) @@ -82,8 +83,11 @@ /*********************************************************************//** * @brief * The rtiNotification function handles real-time interrupt notifications. - * @details Inputs: none - * @details Outputs: RTI notification handled + * these interrupts are used for task timing/scheduling. + * @details \b Inputs: none + * @details \b Outputs: RTI notification handled + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid RTI notifications + * received. * @param notification Which RTI timer caused this interrupt * @return none *************************************************************************/ @@ -116,8 +120,8 @@ /*********************************************************************//** * @brief * The canMessageNotification function handles CAN message notifications. - * @details Inputs: none - * @details Outputs: CAN message notification handled + * @details \b Inputs: none + * @details \b Outputs: CAN message notification handled * @param node which CAN controller * @param messageBox which message box triggered the message notification * @return none @@ -133,8 +137,10 @@ /*********************************************************************//** * @brief * The canErrorNotification function handles CAN error notifications. - * @details Inputs: none - * @details Outputs: CAN error notification handled. + * @details \b Inputs: none + * @details \b Outputs: CAN error notification handled. + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when CAN parity and/or + * CAN bus off error occured. * @param node which CAN controller * @param notification CAN error notification: * canLEVEL_PASSIVE (0x20) : When RX- or TX error counter are between 32 and 63 \n @@ -181,8 +187,8 @@ * @brief * The sciNotification function handles UART communication error interrupts. * Frame and Over-run errors are handled. - * @details Inputs: none - * @details Outputs: UART error interrupts handled. + * @details \b Inputs: none + * @details \b Outputs: UART error interrupts handled. * @param sci Pointer to the SCI peripheral that detected the error * @param flags error flag(s) * @return none @@ -211,8 +217,8 @@ /*********************************************************************//** * @brief * The dmaGroupANotification function handles communication DMA interrupts. - * @details Inputs: none - * @details Outputs: DMA interrupt is handled. + * @details \b Inputs: none + * @details \b Outputs: DMA interrupt is handled. * @param inttype type of DMA interrupt * @param channel DMA channel that caused the interrupt * @return none @@ -244,8 +250,8 @@ * @brief * The getSci2FEOEError function returns the sci2FEOEError (OE - Overrun, * FE - Framing Error) status and resets the status if TRUE - * @details Inputs: sci2FEOEError - * @details Outputs: none + * @details \b Inputs: sci2FEOEError + * @details \b Outputs: none * @return sci2 FE / OE error *************************************************************************/ BOOL getSci2FEOEError( void ) Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -69,13 +69,15 @@ /// Message handling function lookup table static const U16 MSG_FUNCTION_HANDLER_LOOKUP[] = { MSG_ID_TESTER_LOGIN_REQUEST, - MSG_ID_DD_SOFTWARE_RESET_REQUEST + MSG_ID_DD_SOFTWARE_RESET_REQUEST, + MSG_ID_TD_OP_MODE_DATA }; /// Message handling function table static const MsgFuncPtr MSG_FUNCTION_HANDLERS[] = { &handleTesterLogInRequest, - &handleDDSoftwareResetRequest + &handleDDSoftwareResetRequest, + &handleSetTDOperationMode }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLERS) / sizeof(MsgFuncPtr)) @@ -100,8 +102,10 @@ * bit of the sequence # is set if ACK is required per parameter. A sync byte * is inserted at the beginning of the message and an 8-bit CRC is appended to * the end of the message. The message is queued for transmission in the given buffer. - * @details Inputs: none - * @details Outputs: given data array populated with serialized message data and queued for transmit. + * @details \b Inputs: none + * @details \b Outputs: given data array populated with serialized message data and + * queued for transmit. + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when pending ACK list is full. * @param msg message to serialize * @param buffer outgoing buffer that message should be queued in * @param ackReq is an acknowledgement from receiver required? @@ -179,8 +183,8 @@ * @brief * The sendACKMsg function constructs and queues for transmit an ACK message * for a given received message. - * @details Inputs: none - * @details Outputs: ACK message queued for transmit on broadcast CAN channel. + * @details \b Inputs: none + * @details \b Outputs: ACK message queued for transmit on broadcast CAN channel. * @param message message to send an ACK for * @return TRUE if ACK message queued successfully, FALSE if not *************************************************************************/ @@ -208,8 +212,8 @@ * @brief * The sendTestAckResponseMsg function constructs a simple response message for * a handled test message and queues it for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: response message constructed and queued for transmit. + * @details \b Inputs: none + * @details \b Outputs: response message constructed and queued for transmit. * @param msgID ID of handled message that we are responding to * @param buffer outgoing buffer that message should be queued in * @param ack TRUE if test message was handled successfully, FALSE if not @@ -236,8 +240,8 @@ * @brief * The getMsgHandler function finds the appropriate handler function * for the given message. - * @details Inputs: MSG_FUNCTION_HANDLER_LOOKUP[], MSG_FUNCTION_HANDLERS[] - * @details Outputs: none + * @details \b Inputs: MSG_FUNCTION_HANDLER_LOOKUP[], MSG_FUNCTION_HANDLERS[] + * @details \b Outputs: none * @param msgID ID of message to find handler function for * @return pointer to appropriate function to handle given message *************************************************************************/ @@ -262,8 +266,8 @@ * @brief * The handleIncomingMessage function calls the appropriate handler function * for the given message. - * @details Inputs: none - * @details Outputs: Appropriate message handler function called + * @details \b Inputs: none + * @details \b Outputs: Appropriate message handler function called * @param message Incoming message to handle * @return none *************************************************************************/ @@ -308,8 +312,8 @@ * @brief * The sendEvent function constructs an DG event message to the UI and * queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: DG event msg constructed and queued. + * @details \b Inputs: none + * @details \b Outputs: DG event msg constructed and queued. * @param event Enumeration of event type that occurred * @param dat1 First data associated with event * @param dat2 Second data associated with event @@ -345,8 +349,8 @@ * @brief * The broadcastAlarmTriggered function constructs an alarm triggered msg to * be broadcast and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: alarm triggered msg constructed and queued. + * @details \b Inputs: none + * @details \b Outputs: alarm triggered msg constructed and queued. * @param alarm ID of alarm triggered * @param almData1 1st data associated with alarm * @param almData2 2nd data associated with alarm @@ -391,8 +395,8 @@ * @brief * The broadcastAlarmCleared function constructs an alarm cleared msg to be * broadcast and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: alarm cleared msg constructed and queued. + * @details \b Inputs: none + * @details \b Outputs: alarm cleared msg constructed and queued. * @param alarm ID of alarm cleared * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ @@ -420,8 +424,8 @@ * The broadcastAlarmConditionCleared function constructs an alarm condition * cleared msg to be broadcast and queues the msg for transmit on the * appropriate CAN channel. - * @details Inputs: none - * @details Outputs: alarm condition cleared msg constructed and queued. + * @details \b Inputs: none + * @details \b Outputs: alarm condition cleared msg constructed and queued. * @param alarm ID of alarm which alarm condition is cleared * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ @@ -444,6 +448,41 @@ return result; } +// *********************************************************************** +// **************** Message Handling Helper Functions ******************** +// *********************************************************************** + +/*********************************************************************//** + * @brief + * The handleSetTDOperationMode function receives the TD operation modes data + * publish message. + * @details \b Inputs: none + * @details \b Outputs: none + * @param message a pointer to the message to handle + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL handleSetTDOperationMode( MESSAGE_T *message ) +{ + BOOL status = FALSE; + U08* payloadPtr = message->payload; + + // HD mode broadcast is operations mode and submode so 8 bytes + if ( message->hdr.payloadLen == sizeof( U32 ) + sizeof( U32 ) ) + { + U32 mode = 0; + U32 subMode = 0; + + memcpy( &mode, payloadPtr, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( &subMode, payloadPtr, sizeof( U32 ) ); + + setTDOperationMode( mode, subMode ); + status = TRUE; + } + + return status; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -453,8 +492,8 @@ * @brief * The isTestingActivated function determines whether a tester has successfully * logged in to activate testing functionality. - * @details Inputs: testerLoggedIn - * @details Outputs: none + * @details \b Inputs: testerLoggedIn + * @details \b Outputs: none * @return TRUE if a tester has logged in to activate testing, FALSE if not *************************************************************************/ BOOL isTestingActivated( void ) @@ -466,8 +505,8 @@ * @brief * The setTesterStatusToLoggedOut function sets the status of the tester to * logged out. - * @details Inputs: none - * @details Outputs: testerLoggedIn + * @details \b Inputs: none + * @details \b Outputs: testerLoggedIn * @return none *************************************************************************/ void setTesterStatusToLoggedOut( void ) @@ -479,8 +518,8 @@ * @brief * The sendTestAckResponseMsg function constructs a simple response message for * a handled test message and queues it for transmit on the appropriate UART channel. - * @details Inputs: none - * @details Outputs: response message constructed and queued for transmit. + * @details \b Inputs: none + * @details \b Outputs: response message constructed and queued for transmit. * @param msgID ID of handled message that we are responding to * @param ack TRUE if test message was handled successfully, FALSE if not * @return TRUE if response message successfully queued for transmit, FALSE if not @@ -505,8 +544,8 @@ /*********************************************************************//** * @brief * The handleTesterLogInRequest function handles a request to login as a tester. - * @details Inputs: none - * @details Outputs: message handled + * @details \b Inputs: none + * @details \b Outputs: message handled * @param message a pointer to the message to handle * @return none *************************************************************************/ @@ -534,8 +573,8 @@ * @brief * The handleTDSoftwareResetRequest function handles a request to reset the * TD firmware processor. - * @details Inputs: none - * @details Outputs: message handled + * @details \b Inputs: none + * @details \b Outputs: message handled * @param message a pointer to the message to handle * @return FALSE if reset command rejected (won't return if reset successful) *************************************************************************/ Index: firmware/App/Services/Messaging.h =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/Messaging.h (.../Messaging.h) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/Messaging.h (.../Messaging.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -63,6 +63,11 @@ void handleUITDResetInServiceModeRequest( MESSAGE_T* message ); +// handler functions **************************************** + +BOOL handleSetTDOperationMode( MESSAGE_T *message ); + + // Test Support Messaging Functions ************************** BOOL isTestingActivated( void ); Index: firmware/App/Services/MsgQueues.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/MsgQueues.c (.../MsgQueues.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/MsgQueues.c (.../MsgQueues.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -38,8 +38,8 @@ /*********************************************************************//** * @brief * The initMsgQueues function initializes the MsgQueues module. - * @details Inputs: none - * @details Outputs: MsgQueues module initialized + * @details \b Inputs: none + * @details \b Outputs: MsgQueues module initialized * @return none *************************************************************************/ void initMsgQueues( void ) @@ -61,13 +61,15 @@ /*********************************************************************//** * @brief - * The addToMsgQueue function adds a message to a given message queue. - * This function should only be called from the general task. - * @details Inputs: none - * @details Outputs: message added to queue + * The addToMsgQueue function adds a message to a given message queue. * + * @details \b Inputs: none + * @details \b Outputs: message added to queue + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when message queue is full + * or invalid queue passed * @param queue the message queue to add to * @param msg a pointer to a message structure to add to the queue - * @return TRUE if message added to queue, FALSE if could not + * @return TRUE if message added to queue, FALSE if could not + * @warning This function should only be called from the general task. *************************************************************************/ BOOL addToMsgQueue( MSG_QUEUE_T queue, MESSAGE_WRAPPER_T *msg ) { @@ -102,12 +104,15 @@ /*********************************************************************//** * @brief * The getFromMsgQueue function retrieves the next message from a given - * message queue. This function should only be called from the general task. - * @details Inputs: queue - * @details Outputs: message retrieved from the queue + * message queue. + * @details \b Inputs: queue + * @details \b Outputs: message retrieved from the queue + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid queue used to + * retrieve the message. * @param queue the message queue to retrieve from * @param msg a pointer to a message structure to populate with the retrieved message. - * @return TRUE if a message was found to retrieve, FALSE if not + * @return TRUE if a message was found to retrieve, FALSE if not + * @warning This function should only be called from the general task. *************************************************************************/ BOOL getFromMsgQueue( MSG_QUEUE_T queue, MESSAGE_WRAPPER_T *msg ) { @@ -142,8 +147,10 @@ /*********************************************************************//** * @brief * The isMsgQueueEmpty function determines whether a given message queue is empty. - * @details Inputs: msgQueueCounts[] - * @details Outputs: none + * @details \b Inputs: msgQueueCounts[] + * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid message queue being + * passed. * @param queue the message queue to check * @return TRUE if a given message queue is empty, FALSE if not *************************************************************************/ @@ -170,8 +177,10 @@ /*********************************************************************//** * @brief * The isMsgQueueFull function determines whether a given message queue is full. - * @details Inputs: msgQueueCounts[] - * @details Outputs: none + * @details \b Inputs: msgQueueCounts[] + * @details \b Outputs: none + * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when invalid message queue being + * passed. * @param queue the message queue to check * @return TRUE if the given message queue is full, FALSE if not *************************************************************************/ @@ -198,8 +207,8 @@ /*********************************************************************//** * @brief * The blankMessage function blanks a given message. - * @details Inputs: none - * @details Outputs: Zeroed out the message + * @details \b Inputs: none + * @details \b Outputs: Zeroed out the message * @param message Pointer to the message to blank * @return none *************************************************************************/ @@ -219,8 +228,8 @@ /*********************************************************************//** * @brief * The blankMessageInWrapper function blanks a given message in a wrapper. - * @details Inputs: none - * @details Outputs: Zeroed out the message in wrapper + * @details \b Inputs: none + * @details \b Outputs: Zeroed out the message in wrapper * @param message pointer to the message in a wrapper to blank * @return none *************************************************************************/ Index: firmware/App/Services/SystemCommDD.c =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/SystemCommDD.c (.../SystemCommDD.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -38,7 +38,7 @@ // ********** private definitions ********** -#define HD_COMM_TIMEOUT_IN_MS 2000 ///< HD has not sent any broadcast messages for this much time +#define TD_COMM_TIMEOUT_IN_MS 2000 ///< TD has not sent any broadcast messages for this much time #define MAX_COMM_CRC_FAILURES 5 ///< maximum number of CRC errors within window period before alarm #define MAX_COMM_CRC_FAILURE_WINDOW_MS (10 * SEC_PER_MIN * MS_PER_SECOND) ///< CRC error window @@ -55,7 +55,6 @@ COMM_BUFFER_OUT_CAN_DD_ALARM, COMM_BUFFER_OUT_CAN_DD_2_TD, COMM_BUFFER_OUT_CAN_DD_2_RO, - //COMM_BUFFER_OUT_CAN_DD_2_UI, COMM_BUFFER_OUT_CAN_DD_BROADCAST, COMM_BUFFER_OUT_CAN_PC }; @@ -70,26 +69,28 @@ COMM_BUFFER_IN_CAN_TD_BROADCAST, COMM_BUFFER_IN_CAN_RO_2_DD, COMM_BUFFER_IN_CAN_RO_BROADCAST, - //COMM_BUFFER_IN_CAN_UI_2_DD, COMM_BUFFER_IN_CAN_UI_BROADCAST, COMM_BUFFER_IN_CAN_PC, }; static volatile BOOL ddIsOnlyCANNode = TRUE; ///< flag indicating whether DG is alone on CAN bus. -static OVERRIDE_U32_T hdCommunicationStatus = {0, 0, 0, 0}; ///< has HD sent a message since last check -static volatile U32 timeOfLastHDCheckIn = 0; ///< last time we received an HD broadcast +static OVERRIDE_U32_T tdCommunicationStatus = {0, 0, 0, 0}; ///< has TD sent a message since last check +static volatile U32 timeOfLastTDCheckIn = 0; ///< last time we received an TD broadcast // ********** private function prototypes ********** /*********************************************************************//** * @brief * The initSystemCommDD function initializes the DD SystemComm module. - * @details Inputs: none - * @details Outputs: SystemComm module initialized. + * @details \b Inputs: none + * @details \b Outputs: SystemComm module initialized. * @return none *************************************************************************/ void initSystemCommDD( void ) { + // Initialize common system comm unit + initSystemComm(); + // initialize bad message CRC time windowed count initTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC, MAX_COMM_CRC_FAILURES, MAX_COMM_CRC_FAILURE_WINDOW_MS ); @@ -102,21 +103,21 @@ * @brief * The isTDCommunicating function determines whether the TD is communicating * with the DD. - * @details Inputs: hdIsCommunicating - * @details Outputs: none - * @return TRUE if HD has broadcast since last call, FALSE if not + * @details \b Inputs: tdIsCommunicating + * @details \b Outputs: none + * @return TRUE if TD has broadcast since last call, FALSE if not *************************************************************************/ BOOL isTDCommunicating( void ) { - return getU32OverrideValue( &hdCommunicationStatus ); + return getU32OverrideValue( &tdCommunicationStatus ); } /*********************************************************************//** * @brief * The isOnlyCANNode function determines whether the DD is the only node * currently on the CAN bus. - * @details Inputs: ddIsOnlyCANNode - * @details Outputs: none + * @details \b Inputs: ddIsOnlyCANNode + * @details \b Outputs: none * @return TRUE if DD is only node on CAN bus, FALSE if not *************************************************************************/ BOOL isOnlyCANNode( void ) @@ -128,9 +129,9 @@ * @brief * The setOnlyCANNode function sets whether the DD is the only node * currently on the CAN bus. - * @details Inputs: none - * @details Outputs: ddIsOnlyCANNode - * @return only TRUE if HD is only node on CAN bus, FALSE if not + * @details \b Inputs: none + * @details \b Outputs: ddIsOnlyCANNode + * @return only TRUE if TD is only node on CAN bus, FALSE if not *************************************************************************/ void setOnlyCANNode( BOOL only ) { @@ -140,8 +141,8 @@ /*********************************************************************//** * @brief * The clearCANXmitBuffers function clears all CAN transmit buffers. - * @details Inputs: CAN_OUT_BUFFERS[] - * @details Outputs: CAN transmit buffers cleared. + * @details \b Inputs: CAN_OUT_BUFFERS[] + * @details \b Outputs: CAN transmit buffers cleared. * @return none *************************************************************************/ void clearCANXmitBuffers( void ) @@ -157,26 +158,26 @@ /*********************************************************************//** * @brief * The checkForCommTimeouts function checks for sub-system communication timeout errors. - * @details Inputs: timeOfLastDGCheckIn, timeOfLastUICheckIn - * @details Outputs: possibly a comm t/o alarm + * @details \b Inputs: timeOfLastDGCheckIn, timeOfLastUICheckIn + * @details \b Outputs: possibly a comm t/o alarm * @return none *************************************************************************/ void checkForCommTimeouts( void ) { - if ( TRUE == didTimeout( timeOfLastHDCheckIn, HD_COMM_TIMEOUT_IN_MS ) ) + if ( TRUE == didTimeout( timeOfLastTDCheckIn, TD_COMM_TIMEOUT_IN_MS ) ) { - hdCommunicationStatus.data = FALSE; - //setHDOperationMode( 0, 0 ); // If HD off or not connected, consider HD mode is fault. - //stopHeater( DG_TRIMMER_HEATER ); // If HD off or not connected, ensure trimmer heater is off. + tdCommunicationStatus.data = FALSE; + setTDOperationMode( 0, 0 ); // If TD off or not connected, consider TD mode is fault. + //stopHeater( DG_TRIMMER_HEATER ); // If TD off or not connected, ensure trimmer heater is off. } } /*********************************************************************//** * @brief * The getInBufferID function gets the buffer ID for a given buffer index. - * @details Inputs: CAN_IN_BUFFERS[] - * @details Outputs: none + * @details \b Inputs: CAN_IN_BUFFERS[] + * @details \b Outputs: none * @param idx incoming buffer index (e.g. 0 indicates first incoming buffer) * @return buffer id associated with given incoming buffer index *************************************************************************/ @@ -202,15 +203,16 @@ * The checkTooManyBadMsgCRCs function checks for too many bad message CRCs * within a set period of time. Assumed function is being called when a new * bad CRC is detected so a new bad CRC will be added to the list. - * @details Inputs: badCRCTimeStamps[], badCRCListIdx, badCRCListCount - * @details Outputs: possibly a "too many bad CRCs" alarm + * @details \b Inputs: badCRCTimeStamps[], badCRCListIdx, badCRCListCount + * @details \b Outputs: possibly a "too many bad CRCs" alarm + * @details \b Alarm: ALARM_ID_DD_COMM_TOO_MANY_BAD_CRCS when too many bad + * message CRC seen. * @return none *************************************************************************/ void checkTooManyBadMsgCRCs( void ) { if ( TRUE == incTimeWindowedCount( TIME_WINDOWED_COUNT_BAD_MSG_CRC ) ) { - //TODO : define alarm ID SET_ALARM_WITH_1_U32_DATA( ALARM_ID_DD_COMM_TOO_MANY_BAD_CRCS, 2 ); // 2 for DG } } @@ -219,8 +221,8 @@ /*********************************************************************//** * @brief * The getOutBufferID function gets the buffer ID for a given buffer index. - * @details Inputs: CAN_OUT_BUFFERS[] - * @details Outputs: none + * @details \b Inputs: CAN_OUT_BUFFERS[] + * @details \b Outputs: none * @param idx outgoing buffer index (e.g. 0 indicates first outgoing buffer) * @return buffer id associated with given outgoing buffer index *************************************************************************/ @@ -245,8 +247,8 @@ /*********************************************************************//** * @brief * The processReceivedMessage function processes a given message. - * @details Inputs: none - * @details Outputs: message processed + * @details \b Inputs: none + * @details \b Outputs: message processed * @param message pointer to message to process * @return none *************************************************************************/ @@ -264,43 +266,43 @@ /*********************************************************************//** * @brief - * The testSetHDCommunicationStatus function sets the override - * of the HD communication status. - * @details Inputs: none - * @details Outputs: hdCommunicationStatus + * The testSetTDCommunicationStatus function sets the override + * of the TD communication status. + * @details \b Inputs: none + * @details \b Outputs: tdCommunicationStatus * @return TRUE if reset successful, FALSE if not *************************************************************************/ -BOOL testSetHDCommunicationStatus( U32 value ) +BOOL testSetTDCommunicationStatus( U32 value ) { BOOL result = FALSE; if (TRUE == isTestingActivated() ) { result = TRUE; - hdCommunicationStatus.ovData = value; - hdCommunicationStatus.override = OVERRIDE_KEY; + tdCommunicationStatus.ovData = value; + tdCommunicationStatus.override = OVERRIDE_KEY; } return result; } /*********************************************************************//** * @brief - * The testResetHDCommuncationStatus function resets the override - * of the HD communication status. - * @details Inputs: none - * @details Outputs: hdCommunicationStatus + * The testResetTDCommuncationStatus function resets the override + * of the TD communication status. + * @details \b Inputs: none + * @details \b Outputs: tdCommunicationStatus * @return TRUE if reset successful, FALSE if not *************************************************************************/ -BOOL testResetHDCommuncationStatus( void ) +BOOL testResetTDCommuncationStatus( void ) { BOOL result = FALSE; if (TRUE == isTestingActivated() ) { result = TRUE; - hdCommunicationStatus.override = OVERRIDE_RESET; - hdCommunicationStatus.ovData = hdCommunicationStatus.ovInitData; + tdCommunicationStatus.override = OVERRIDE_RESET; + tdCommunicationStatus.ovData = tdCommunicationStatus.ovInitData; } return result; Index: firmware/App/Services/SystemCommDD.h =================================================================== diff -u -r52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Services/SystemCommDD.h (.../SystemCommDD.h) (revision 52ded7b22d4b413aa8182f1343e4fbb78e8c3b0a) +++ firmware/App/Services/SystemCommDD.h (.../SystemCommDD.h) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -52,8 +52,8 @@ void checkForCommTimeouts( void ); void checkTooManyBadMsgCRCs( void ); -BOOL testSetHDCommunicationStatus( U32 value ); -BOOL testResetHDCommuncationStatus( void ); +BOOL testSetTDCommunicationStatus( U32 value ); +BOOL testResetTDCommuncationStatus( void ); /**@}*/ Index: firmware/App/Tasks/TaskBG.c =================================================================== diff -u -r8b8fff67b95805272f37855346d600599aaec03d -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 8b8fff67b95805272f37855346d600599aaec03d) +++ firmware/App/Tasks/TaskBG.c (.../TaskBG.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -29,9 +29,11 @@ /*********************************************************************//** * @brief * The taskBackground function handles the idle background task loop. - * @details Inputs: none - * @details Outputs: Executes the watchdog manangement service - * return none + * @details \b Inputs: none + * @details \b Outputs: Executes the watchdog manangement service + * return none + * @note This task runs when other task ( Timer, priority and general) + * completed their execution and frees CPU for background task execution. *************************************************************************/ void taskBackground( void ) { Index: firmware/App/Tasks/TaskGeneral.c =================================================================== diff -u -rcd3af1ebb7396ba3b2bec1d779510d29c30014f4 -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision cd3af1ebb7396ba3b2bec1d779510d29c30014f4) +++ firmware/App/Tasks/TaskGeneral.c (.../TaskGeneral.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -32,7 +32,7 @@ //#include "Switches.h" #include "SystemComm.h" #include "SystemCommDD.h" -//#include "SystemCommMessages.h" +#include "Messaging.h" #include "TaskGeneral.h" //#include "Thermistors.h" //#include "UVReactors.h" @@ -56,9 +56,10 @@ * The taskGeneral function handles the scheduled general task interrupt. * Calls the executive functions for most monitors and controllers, the * operation modes, the system communications, and alarms. - * @details Inputs: none - * @details Outputs: Executed all general task functions. - * @return none + * @details \b Inputs: none + * @details \b Outputs: Executed all general task functions. + * @return none + * @note This task runs every 50 ms interval. *************************************************************************/ void taskGeneral( void ) { @@ -89,7 +90,7 @@ #endif // run operation mode state machine - //execOperationModes(); + execOperationModes(); #ifndef BOARD_WITH_NO_HARDWARE // Monitor thermistors state machine Index: firmware/App/Tasks/TaskPriority.c =================================================================== diff -u -r8b8fff67b95805272f37855346d600599aaec03d -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 8b8fff67b95805272f37855346d600599aaec03d) +++ firmware/App/Tasks/TaskPriority.c (.../TaskPriority.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -44,8 +44,9 @@ * @brief * The taskPriority function handles the scheduled priority task interrupt. * Calls the executive functions for FPGA, pumps, valves, and buttons. - * @details Inputs: none - * @details Outputs: Executive for the FPGA, pumps, valves, and buttons called. + * @details \b Inputs: none + * @details \b Outputs: Executive for the FPGA, pumps, valves, and buttons called. + * @note This task runs every 10 ms interval. *************************************************************************/ void taskPriority( void ) { @@ -55,7 +56,7 @@ #ifndef BOARD_WITH_NO_HARDWARE // First pass for FPGA - //execFPGAIn(); + execFPGA( TRUE ); // Monitor internal ADC channels //execInternalADC(); @@ -88,7 +89,7 @@ //execHeatersMonitor(); // Second pass for FPGA - //execFPGAOut(); + execFPGA( FALSE ); #endif // Check in with watchdog manager Index: firmware/App/Tasks/TaskTimer.c =================================================================== diff -u -r8b8fff67b95805272f37855346d600599aaec03d -r090cfb22a7c0b4738299c3fb411ca77aaba8d968 --- firmware/App/Tasks/TaskTimer.c (.../TaskTimer.c) (revision 8b8fff67b95805272f37855346d600599aaec03d) +++ firmware/App/Tasks/TaskTimer.c (.../TaskTimer.c) (revision 090cfb22a7c0b4738299c3fb411ca77aaba8d968) @@ -31,8 +31,8 @@ * The taskTimer function handles the scheduled Timer Task interrupt. * Calls the Timers executive to maintain a 1 ms timer counter to * support timer and timeout functions. - * @details Inputs: none - * @details Outputs: Executive for Timers called. + * @details \b Inputs: none + * @details \b Outputs: Executive for Timers called. *************************************************************************/ void taskTimer( void ) {