Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -r9576fd573a9dfefb502da5668841ea5f7fe072f1 -ra6587c2ba0a40bdf12b5fdcf2ba8dec0cd958cfa --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 9576fd573a9dfefb502da5668841ea5f7fe072f1) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision a6587c2ba0a40bdf12b5fdcf2ba8dec0cd958cfa) @@ -57,9 +57,9 @@ // ********** private data ********** static volatile BOOL modeRequest[ NUM_OF_MODES - 1 ]; ///< Pending operation mode change requests. -static HD_OP_MODE_T lastMode = MODE_INIT; ///< Last operation mode prior to current mode. -static HD_OP_MODE_T currentMode = MODE_INIT; ///< Current operation mode. -static U32 currentSubMode = 0; ///< The currently active state of the active mode. +static HD_OP_MODE_T lastMode; ///< Last operation mode prior to current mode. +static HD_OP_MODE_T currentMode; ///< Current operation mode. +static U32 currentSubMode; ///< The currently active state of the active mode. static U32 broadcastModeIntervalCtr; ///< Interval counter used to determine when to broadcast operation mode. Initialize to 11 to stagger broadcast. /// Interval (in task intervals) at which to publish operation mode data to CAN bus. static OVERRIDE_U32_T opModePublishInterval = { BROADCAST_HD_OP_MODE_INTERVAL, BROADCAST_HD_OP_MODE_INTERVAL, BROADCAST_HD_OP_MODE_INTERVAL, 0 }; @@ -107,6 +107,7 @@ } // Start in init mode + lastMode = MODE_INIT; currentMode = MODE_INIT; currentSubMode = 0; broadcastModeIntervalCtr = DATA_PUBLISH_COUNTER_START_COUNT; @@ -472,7 +473,7 @@ if ( confirmRequests[ i ].requestID == request_id ) { status = confirmRequests[ i ].status; - if ( CONFIRMATION_REQUEST_STATUS_PENDING != status) + if ( CONFIRMATION_REQUEST_STATUS_PENDING != status ) { // Send UI clear if ( CONFIRMATION_REQUEST_STATUS_TIMEOUT == confirmRequests[ i ].status ) @@ -557,7 +558,7 @@ for ( i = 0; i < NUM_CONFIRM_REQUESTS; i++ ) { - if ( confirmRequests[ i ].status == CONFIRMATION_REQUEST_STATUS_UNUSED ) + if ( CONFIRMATION_REQUEST_STATUS_UNUSED == confirmRequests[ i ].status ) { // Save the confirmation request info confirmRequests[ i ].requestID = request_id; @@ -566,7 +567,6 @@ confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_PENDING; new_id = request_id; sendConfirmationRequest( request_id, request_type, reject_reason ); - break; } }