Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r13a064292b5a36a85593f53eabae268ae2bf4bc6 -r8639aa012127798aeb8fd719dd7f93b83275f944 --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 13a064292b5a36a85593f53eabae268ae2bf4bc6) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 8639aa012127798aeb8fd719dd7f93b83275f944) @@ -142,6 +142,10 @@ U32 priorSubState = currentSubState; U32 prior4thLevelState = current4thLevelState; + // Check for the UF rate confirmation message from UI and if it has been received, process it. + // This function is called here to make sure the UF rate screen is always serviced so it does not get hung up + handleUFRateConfirmationMessageFromUI(); + // Any new mode requests? newMode = arbitrateModeRequest(); // Will return current mode if no pending requests @@ -445,13 +449,20 @@ * @param requestID ID of confirmation being requested * @return Status of given confirmation *************************************************************************/ -CONFIRMATION_REQUEST_STATUS_T getConfirmationRequestStatus( GENERIC_CONFIRM_ID_T requestID ) +CONFIRMATION_REQUEST_STATUS_T getConfirmationRequestStatus( GENERIC_CONFIRM_ID_T requestID, F32 payload1, F32 payload2, F32 payload3, F32 payload4 ) { BOOL pending = FALSE; U32 pendingIndex = 0; CONFIRMATION_REQUEST_STATUS_T status = CONFIRMATION_REQUEST_STATUS_PENDING; U32 i; + GENERIC_CONFIRMATION_REQUEST_T genConfRqst; + genConfRqst.rejectReason = 0; + genConfRqst.genericPayload1 = payload1; + genConfRqst.genericPayload2 = payload2; + genConfRqst.genericPayload3 = payload3; + genConfRqst.genericPayload4 = payload3; + for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { if ( confirmRequests[ i ].requestID == requestID ) @@ -462,18 +473,24 @@ // Send UI clear if ( CONFIRMATION_REQUEST_STATUS_TIMEOUT == status ) { - sendConfirmationRequest( confirmRequests[ i ].requestID, GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE, 0 ); + genConfRqst.requestID = (U32)confirmRequests[ i ].requestID; + genConfRqst.requestType = (U32)GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE; + + sendConfirmationRequest( &genConfRqst ); } else { - sendConfirmationRequest( confirmRequests[ i ].requestID, GENERIC_CONFIRM_CMD_ACCEPT_CLOSE, 0 ); + genConfRqst.requestID = (U32)confirmRequests[ i ].requestID; + genConfRqst.requestType = (U32)GENERIC_CONFIRM_CMD_ACCEPT_CLOSE; + + sendConfirmationRequest( &genConfRqst ); } // Clear the confirmation request, it is done and consumed - confirmRequests[ i ].requestID = GENERIC_CONFIRM_ID_NONE; + confirmRequests[ i ].requestID = GENERIC_CONFIRM_ID_NONE; confirmRequests[ i ].requestType = GENERIC_CONFIRM_CMD_REQUEST_OPEN; - confirmRequests[ i ].timeStamp = 0; - confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_UNUSED; + confirmRequests[ i ].timeStamp = 0; + confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_UNUSED; } } else if ( CONFIRMATION_REQUEST_STATUS_PENDING == confirmRequests[ i ].status ) @@ -496,8 +513,11 @@ if ( ( CONFIRMATION_REQUEST_STATUS_PENDING != status ) && ( TRUE == pending ) ) { + genConfRqst.requestID = (U32)confirmRequests[ i ].requestID; + genConfRqst.requestType = (U32)confirmRequests[ pendingIndex ].requestType; + // Last confirmation cleared, pending request must be resent to UI - sendConfirmationRequest( confirmRequests[ pendingIndex ].requestID, confirmRequests[ pendingIndex ].requestType, 0 ); + sendConfirmationRequest( &genConfRqst ); } return status; @@ -531,12 +551,10 @@ * The addConfirmationRequest function sends a confirmation request to UI * @details Inputs: confirmRequests[] * @details Outputs: confirmRequests[] new added. - * @param requestID ID of confirmation being requested - * @param requestType Type of confirmation being requested (open, close, reject) - * @param rejectReason Reason for reject if type is reject + * @param request pointer to generic confirmation message request structure * @return request ID - will be non-zero if added *************************************************************************/ -GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, GENERIC_CONFIRM_COMMAND_T requestType, U32 rejectReason ) +GENERIC_CONFIRM_ID_T addConfirmationRequest( GENERIC_CONFIRMATION_REQUEST_T *request ) { U32 i; BOOL confirmAlreadyPending = FALSE; @@ -545,7 +563,7 @@ // Check to make sure specified confirmation is not already pending for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { - if ( ( confirmRequests[ i ].requestID == requestID ) && + if ( ( confirmRequests[ i ].requestID == request->requestID ) && ( confirmRequests[ i ].status != CONFIRMATION_REQUEST_STATUS_UNUSED ) ) { confirmAlreadyPending = TRUE; @@ -556,17 +574,30 @@ // If not already pending, add confirmation to list of pending confirmations and send to UI to be displayed if ( confirmAlreadyPending != TRUE ) { + GENERIC_CONFIRMATION_REQUEST_T genConfRqst; + + genConfRqst.rejectReason = request->rejectReason; + genConfRqst.genericPayload1 = request->genericPayload1; + genConfRqst.genericPayload2 = request->genericPayload2; + genConfRqst.genericPayload3 = request->genericPayload3; + genConfRqst.genericPayload4 = request->genericPayload4; + for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { if ( CONFIRMATION_REQUEST_STATUS_UNUSED == confirmRequests[ i ].status ) { // Save the confirmation request info - confirmRequests[ i ].requestID = requestID; - confirmRequests[ i ].requestType = requestType; - confirmRequests[ i ].timeStamp = getMSTimerCount(); - confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_PENDING; - newID = requestID; - sendConfirmationRequest( requestID, requestType, rejectReason ); + confirmRequests[ i ].requestID = (GENERIC_CONFIRM_ID_T)request->requestID; + confirmRequests[ i ].requestType = (GENERIC_CONFIRM_COMMAND_T)request->requestType; + confirmRequests[ i ].timeStamp = getMSTimerCount(); + confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_PENDING; + newID = (GENERIC_CONFIRM_ID_T)request->requestID; + + // Get ready for the generic confirmation request + genConfRqst.requestID = request->requestID; + genConfRqst.requestType = request->requestType; + + sendConfirmationRequest( &genConfRqst ); break; } }