Index: firmware/App/Services/Download.c =================================================================== diff -u -r9e2779d825ea7e7b3445fa365f7bc2206fc0613a -rec37f8c4308fb2ab322706bd8b5f1af013cd18c9 --- firmware/App/Services/Download.c (.../Download.c) (revision 9e2779d825ea7e7b3445fa365f7bc2206fc0613a) +++ firmware/App/Services/Download.c (.../Download.c) (revision ec37f8c4308fb2ab322706bd8b5f1af013cd18c9) @@ -126,6 +126,9 @@ if ( bytesInBuffer >= NUM_OF_CAN_BYTES_FOR_UPDATE ) { + SW_UPDATE_RESP_STATUS_T resp; + + BOOL status = FALSE; U32 calcCRC = 0; BOOL hasCRCPassed = FALSE; ACK_NACK_STATUS_T ackStatus = NACK; @@ -141,10 +144,6 @@ if ( TRUE == hasCRCPassed ) { - SW_UPDATE_RESP_STATUS_T resp; - - BOOL status = FALSE; - switch ( SWUpdateRCVStatus.updateDest ) { case UPDATE_FIRMWARE: @@ -166,12 +165,11 @@ // Do nothing break; } - - prepareResponseMessage( SWUpdateRCVStatus.msgID, ackStatus, &resp ); - status = sendAckNackStatusFromFirmware( (U08*)&resp ); // TODO do we have to retry if send failed? - clearCommBuffer( mailBox ); } + prepareResponseMessage( SWUpdateRCVStatus.msgID, ackStatus, &resp ); + status = sendAckNackStatusFromFirmware( (U08*)&resp ); // TODO do we have to retry if send failed? + clearCommBuffer( mailBox ); // TODo does this need to here? How about resync? clearSWUpdateBuffer(); } }