From 83dff73d8f9116b2bb7c8bd868bc88f486a386e3 Mon Sep 17 00:00:00 2001 From: john Date: Mon, 14 Nov 2011 14:04:01 +0100 Subject: [PATCH] Added workaround for HCS12 compiler-bug (Ticket #1083) --- communication/Com/Com.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/communication/Com/Com.c b/communication/Com/Com.c index f897bb40..2f405e9d 100644 --- a/communication/Com/Com.c +++ b/communication/Com/Com.c @@ -247,6 +247,7 @@ BufReq_ReturnType Com_CopyRxData(PduIdType PduId, const PduInfoType* PduInfoPtr, Irq_Restore(state); } BufReq_ReturnType Com_StartOfReception(PduIdType ComRxPduId, PduLengthType TpSduLength, PduLengthType* RxBufferSizePtr) { + PduLengthType ComIPduSize; imask_t state; Irq_Save(state); BufReq_ReturnType r = BUFREQ_OK; @@ -254,9 +255,10 @@ BufReq_ReturnType Com_StartOfReception(PduIdType ComRxPduId, PduLengthType TpSdu if (Arc_IPdu->Com_Arc_IpduStarted) { if (GET_IPdu(ComRxPduId)->ComIPduDirection == RECEIVE) { if (!Com_BufferPduState[ComRxPduId].locked) { - if (GET_IPdu(ComRxPduId)->ComIPduSize >= TpSduLength) { + ComIPduSize = GET_IPdu(ComRxPduId)->ComIPduSize; + if (ComIPduSize >= TpSduLength) { Com_BufferPduState[ComRxPduId].locked = true; - *RxBufferSizePtr = GET_IPdu(ComRxPduId)->ComIPduSize; + *RxBufferSizePtr = ComIPduSize; Com_BufferPduState[ComRxPduId].locked = true; } else { r = BUFREQ_OVFL; -- 2.39.2