Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r30f049651877229042e3f8700c8596e5b9a1e0f4 -r8c00197ce69e80f1967aa3f2eb36beb3573f36f3 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 30f049651877229042e3f8700c8596e5b9a1e0f4) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 8c00197ce69e80f1967aa3f2eb36beb3573f36f3) @@ -37,7 +37,8 @@ // ********** private data ********** -#define BROADCAST_HD_OP_MODE_INTERVAL ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ) ///< HD operation mode broadcast interval (in task interval/sec). +/// HD operation mode broadcast interval (in task interval/sec). +static const U32 BROADCAST_HD_OP_MODE_INTERVAL = ( MS_PER_SECOND / TASK_GENERAL_INTERVAL ); // ********** private data ********** @@ -352,4 +353,38 @@ } } + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +/*********************************************************************//** + * @brief + * The testSetOperationMode function will transition to a given operation + * mode if the transition is legal. + * @details Inputs: none + * @details Outputs: modeRequest[] + * @param newMode ID of requested mode to transition to + * @return TRUE if request successful, FALSE if not + *************************************************************************/ +BOOL testSetOperationMode( HD_OP_MODE_T newMode ) +{ + BOOL result = FALSE; + + if ( TRUE == isTestingActivated() ) + { + HD_OP_MODE_T check = MODE_TRANSITION_TABLE[ currentMode ][ newMode ]; + + // Is mode transition legal? + if ( check == newMode ) + { + requestNewOperationMode( newMode ); + result = TRUE; + } + } + + return result; +} + /**@}*/