Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rf688e0f8bded1f0a687437e3136cfba8b14f87b6 -r9ea1971251bb0064e626c21e7d94215114254a98 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision f688e0f8bded1f0a687437e3136cfba8b14f87b6) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 9ea1971251bb0064e626c21e7d94215114254a98) @@ -66,12 +66,14 @@ /// Message handling function lookup table static const U16 MSG_FUNCTION_HANDLER_LOOKUP[][2] = { - { MSG_ID_TESTER_LOGIN_REQUEST, 0 }, + { MSG_ID_TD_SOFTWARE_RESET_REQUEST, 0 }, + { MSG_ID_TESTER_LOGIN_REQUEST, 1 } }; /// Message handling function table static const MsgFuncPtr MSG_FUNCTION_HANDLERS[] = { - &handleTesterLogInRequest, + &handleTDSoftwareResetRequest, + &handleTesterLogInRequest }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLERS) / sizeof(MsgFuncPtr)) @@ -386,7 +388,7 @@ // Create a message record blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_EVENT; + msg.hdr.msgID = MSG_ID_TD_EVENT; // The payload length is the event ID, 2 event datas and the events data types for each of the event data msg.hdr.payloadLen = sizeof( EVENT_PAYLOAD_T ); @@ -398,7 +400,32 @@ return result; } +/*********************************************************************//** + * @brief + * The handleTDSoftwareResetRequest function handles a request to reset the + * TD firmware processor. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return FALSE if reset command rejected (won't return if reset successful) + *************************************************************************/ +BOOL handleTDSoftwareResetRequest( MESSAGE_T *message ) +{ + BOOL result = FALSE; + // Verify payload length + if ( 0 == message->hdr.payloadLen ) + { // S/w reset of processor + result = TRUE; // Reset will prevent this from getting transmitted though +#ifndef _VECTORCAST_ + systemREG1->SYSECR = (0x2) << 14; // Reset processor +#endif + } + + return result; +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/