Bläddra i källkod

【20220118】优化CAN收发函数

BJQX-ZHENGCHAO\Zhengchao 3 år sedan
förälder
incheckning
9fed546e69

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+D:\Work\NXPWorkSpace\S32K144_Project_CAN_UART_DIO\Debug_FLASH

BIN
Debug_FLASH/S32K144_Project_CAN_UART_DIO.elf


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1026 - 1025
Debug_FLASH/S32K144_Project_CAN_UART_DIO.map


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 301 - 340
Debug_FLASH/src/main.c.000i.cgraph


+ 1 - 2
Debug_FLASH/src/main.c.000i.ipa-clones

@@ -1,2 +1 @@
-Callgraph clone;Can_GetMsgInfo;47;../src/main.c;250;0;CanIf_RxIndication;51;../src/main.c;279;0;inlining to
-Callgraph clone;Can_CreatePduInfo;46;../src/main.c;222;0;main;60;../src/main.c;530;0;inlining to
+Callgraph clone;Can_GetMsgInfo;40;../src/main.c;204;0;CanIf_RxIndication;44;../src/main.c;233;0;inlining to

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 246 - 210
Debug_FLASH/src/main.c.016i.visibility


+ 296 - 152
Debug_FLASH/src/main.c.017i.build_ssa_passes

@@ -3,14 +3,13 @@ main ()
   uint8 u8TimeOut;
   uint8 rxBuffer[100];
   volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo1;
-  static struct Can_PduType Can_PduInfo;
+  static struct Can_Msg_Type Can_MsgInfo;
   volatile Std_ReturnType R_Uart_Status2;
   volatile Std_ReturnType R_Uart_Status1;
   volatile Std_ReturnType T_Uart_Status3;
   volatile Std_ReturnType T_Uart_Status2;
   volatile Std_ReturnType T_Uart_Status1;
-  int D.9406;
+  int D.9424;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -22,7 +21,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   u8TimeOut = 100;
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -68,21 +66,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  Can_PduInfo = Can_CreatePduInfo (85, 2, 0, 8, &Can_au8Sdu8bytes);
-  # DEBUG BEGIN_STMT
   Can_SetControllerMode (0, 1);
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.id = 403846230;
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.idFrame = 2;
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.length = 8;
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 = pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 = pinValue;
+  _2 = ~pinValue.34_1;
   pinValue = _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status = _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -112,21 +113,21 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> :
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [INV]
   else
     goto <bb 5>; [INV]
 
   <bb 4> :
   # DEBUG BEGIN_STMT
-  bufferIdx.27_2 = bufferIdx;
-  _3 = bufferIdx.27_2 + 20;
+  bufferIdx.31_2 = bufferIdx;
+  _3 = bufferIdx.31_2 + 20;
   bufferIdx = _3;
   # DEBUG BEGIN_STMT
   _4 = (unsigned char) hwInstance;
-  bufferIdx.28_5 = bufferIdx;
-  _6 = &RX_Buffer[hwInstance][bufferIdx.28_5];
+  bufferIdx.32_5 = bufferIdx;
+  _6 = &RX_Buffer[hwInstance][bufferIdx.32_5];
   Uart_SetBuffer (_4, _6, 20, 1);
 
   <bb 5> :
@@ -143,8 +144,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   _9 = (long unsigned int) _8;
   temp = 20 - _9;
   # DEBUG BEGIN_STMT
-  bufferIdx.29_10 = bufferIdx;
-  _11 = temp + bufferIdx.29_10;
+  bufferIdx.33_10 = bufferIdx;
+  _11 = temp + bufferIdx.33_10;
   bufferIdx = _11;
   # DEBUG BEGIN_STMT
   _12 = (unsigned char) hwInstance;
@@ -156,14 +157,14 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
   uint32 T_bytesRemaining;
   volatile Uart_StatusType Uart_ReceiveStatus;
   volatile Std_ReturnType R_Uart_Status;
-  uint32 D.9393;
+  uint32 D.9409;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -175,84 +176,97 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   retVal = 1;
   # DEBUG BEGIN_STMT
+  if (rxBuffer == 0B)
+    goto <bb 3>; [INV]
+  else
+    goto <bb 4>; [INV]
+
+  <bb 3> :
+  # DEBUG BEGIN_STMT
+  D.9409 = retVal;
+  // predicted unlikely by early return (on trees) predictor.
+  goto <bb 12>; [INV]
+
+  <bb 4> :
+  # DEBUG BEGIN_STMT
   _1 = (int) recvChannel;
   _2 = &RX_Buffer[_1][0];
   Uart_SetBuffer (recvChannel, _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel, RxBuffer, 20);
+  _3 = Uart_AsyncReceive (recvChannel, rxBuffer, 20);
   R_Uart_Status = _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 = R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [INV]
+  R_Uart_Status.27_4 = R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 5>; [INV]
   else
-    goto <bb 4>; [INV]
+    goto <bb 6>; [INV]
 
-  <bb 3> :
+  <bb 5> :
   # DEBUG BEGIN_STMT
   Uart_Abort (recvChannel, 1);
   # DEBUG BEGIN_STMT
-  D.9393 = 1;
+  D.9409 = 1;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 10>; [INV]
+  goto <bb 12>; [INV]
 
-  <bb 4> :
+  <bb 6> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   _5 = Uart_GetStatus (recvChannel, &T_bytesRemaining, 1);
   Uart_ReceiveStatus = _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 = Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [INV]
+  Uart_ReceiveStatus.28_6 = Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 7>; [INV]
   else
-    goto <bb 6>; [INV]
+    goto <bb 8>; [INV]
 
-  <bb 5> :
+  <bb 7> :
   timeout = timeout + 4294967295;
   if (timeout != 0)
-    goto <bb 4>; [INV]
-  else
     goto <bb 6>; [INV]
+  else
+    goto <bb 8>; [INV]
 
-  <bb 6> :
+  <bb 8> :
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 = Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [INV]
+  Uart_ReceiveStatus.29_7 = Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 9>; [INV]
   else
-    goto <bb 8>; [INV]
+    goto <bb 10>; [INV]
 
-  <bb 7> :
+  <bb 9> :
   # DEBUG BEGIN_STMT
   Uart_Abort (recvChannel, 1);
   # DEBUG BEGIN_STMT
   retVal = 1;
-  goto <bb 9>; [INV]
+  goto <bb 11>; [INV]
 
-  <bb 8> :
+  <bb 10> :
   # DEBUG BEGIN_STMT
   retVal = 0;
 
-  <bb 9> :
+  <bb 11> :
   # DEBUG BEGIN_STMT
-  D.9393 = retVal;
+  D.9409 = retVal;
 
-  <bb 10> :
+  <bb 12> :
   T_bytesRemaining = {CLOBBER};
-  return D.9393;
+  return D.9409;
 
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
   uint32 T_bytesRemaining;
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
-  Std_ReturnType D.9384;
+  Std_ReturnType D.9398;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -264,75 +278,88 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   retVal = 1;
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel, pBuffer, sendLength, 0);
-  # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel, pBuffer, sendLength);
-  T_Uart_Status = _1;
-  # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 = T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
+  if (txBuffer == 0B)
     goto <bb 3>; [INV]
   else
     goto <bb 4>; [INV]
 
   <bb 3> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel, 0);
-  # DEBUG BEGIN_STMT
-  D.9384 = 1;
+  D.9398 = (Std_ReturnType) retVal;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 10>; [INV]
+  goto <bb 12>; [INV]
 
   <bb 4> :
   # DEBUG BEGIN_STMT
+  Uart_SetBuffer (transChannel, txBuffer, sendLength, 0);
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel, &T_bytesRemaining, 0);
-  Uart_TransmitStatus = _3;
+  _1 = Uart_AsyncSend (transChannel, txBuffer, sendLength);
+  T_Uart_Status = _1;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 = Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
+  T_Uart_Status.24_2 = T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
     goto <bb 5>; [INV]
   else
     goto <bb 6>; [INV]
 
   <bb 5> :
-  timeout = timeout + 4294967295;
-  if (timeout != 0)
-    goto <bb 4>; [INV]
-  else
-    goto <bb 6>; [INV]
+  # DEBUG BEGIN_STMT
+  Uart_Abort (transChannel, 0);
+  # DEBUG BEGIN_STMT
+  D.9398 = 1;
+  // predicted unlikely by early return (on trees) predictor.
+  goto <bb 12>; [INV]
 
   <bb 6> :
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 = Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
+  # DEBUG BEGIN_STMT
+  _3 = Uart_GetStatus (transChannel, &T_bytesRemaining, 0);
+  Uart_TransmitStatus = _3;
+  # DEBUG BEGIN_STMT
+  Uart_TransmitStatus.25_4 = Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
     goto <bb 7>; [INV]
   else
     goto <bb 8>; [INV]
 
   <bb 7> :
+  timeout = timeout + 4294967295;
+  if (timeout != 0)
+    goto <bb 6>; [INV]
+  else
+    goto <bb 8>; [INV]
+
+  <bb 8> :
+  # DEBUG BEGIN_STMT
+  Uart_TransmitStatus.26_5 = Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 9>; [INV]
+  else
+    goto <bb 10>; [INV]
+
+  <bb 9> :
   # DEBUG BEGIN_STMT
   Uart_Abort (transChannel, 0);
   # DEBUG BEGIN_STMT
   retVal = 1;
-  goto <bb 9>; [INV]
+  goto <bb 11>; [INV]
 
-  <bb 8> :
+  <bb 10> :
   # DEBUG BEGIN_STMT
   retVal = 0;
 
-  <bb 9> :
+  <bb 11> :
   # DEBUG BEGIN_STMT
-  D.9384 = (Std_ReturnType) retVal;
+  D.9398 = (Std_ReturnType) retVal;
 
-  <bb 10> :
+  <bb 12> :
   T_bytesRemaining = {CLOBBER};
-  return D.9384;
+  return D.9398;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -341,7 +368,7 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   volatile Uart_StatusType Uart_ReceiveStatus;
   volatile Std_ReturnType T_Uart_Status;
   volatile Std_ReturnType R_Uart_Status;
-  Std_ReturnType D.9369;
+  Std_ReturnType D.9381;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -356,49 +383,68 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   retVal = 1;
   # DEBUG BEGIN_STMT
+  if (txBuffer == 0B)
+    goto <bb 4>; [INV]
+  else
+    goto <bb 3>; [INV]
+
+  <bb 3> :
+  if (rxBuffer == 0B)
+    goto <bb 4>; [INV]
+  else
+    goto <bb 5>; [INV]
+
+  <bb 4> :
+  # DEBUG BEGIN_STMT
+  D.9381 = (Std_ReturnType) retVal;
+  // predicted unlikely by early return (on trees) predictor.
+  goto <bb 19>; [INV]
+
+  <bb 5> :
+  # DEBUG BEGIN_STMT
   _1 = (int) recvChannel;
   _2 = &RX_Buffer[_1][0];
   Uart_SetBuffer (recvChannel, _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel, RxBuffer, 20);
+  _3 = Uart_AsyncReceive (recvChannel, rxBuffer, 20);
   R_Uart_Status = _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 = T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [INV]
+  T_Uart_Status.18_4 = T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 6>; [INV]
   else
-    goto <bb 4>; [INV]
+    goto <bb 7>; [INV]
 
-  <bb 3> :
+  <bb 6> :
   # DEBUG BEGIN_STMT
   Uart_Abort (recvChannel, 1);
   # DEBUG BEGIN_STMT
-  D.9369 = 1;
+  D.9381 = 1;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 16>; [INV]
+  goto <bb 19>; [INV]
 
-  <bb 4> :
+  <bb 7> :
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel, pBuffer, sendLength, 0);
+  Uart_SetBuffer (transChannel, txBuffer, sendLength, 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel, pBuffer, sendLength);
+  _5 = Uart_AsyncSend (transChannel, txBuffer, sendLength);
   T_Uart_Status = _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 = T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [INV]
+  T_Uart_Status.19_6 = T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 8>; [INV]
   else
-    goto <bb 6>; [INV]
+    goto <bb 9>; [INV]
 
-  <bb 5> :
+  <bb 8> :
   # DEBUG BEGIN_STMT
   Uart_Abort (transChannel, 0);
   # DEBUG BEGIN_STMT
-  D.9369 = 1;
+  D.9381 = 1;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 16>; [INV]
+  goto <bb 19>; [INV]
 
-  <bb 6> :
+  <bb 9> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   _7 = Uart_GetStatus (transChannel, &T_bytesRemaining, 0);
@@ -407,71 +453,71 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   _8 = Uart_GetStatus (recvChannel, &T_bytesRemaining, 1);
   Uart_ReceiveStatus = _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 = Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [INV]
+  Uart_TransmitStatus.20_9 = Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 10>; [INV]
   else
-    goto <bb 9>; [INV]
+    goto <bb 12>; [INV]
 
-  <bb 7> :
-  Uart_ReceiveStatus.17_10 = Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [INV]
+  <bb 10> :
+  Uart_ReceiveStatus.21_10 = Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 11>; [INV]
   else
-    goto <bb 9>; [INV]
+    goto <bb 12>; [INV]
 
-  <bb 8> :
+  <bb 11> :
   timeout = timeout + 4294967295;
   if (timeout != 0)
-    goto <bb 6>; [INV]
-  else
     goto <bb 9>; [INV]
+  else
+    goto <bb 12>; [INV]
 
-  <bb 9> :
+  <bb 12> :
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 = Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [INV]
+  Uart_TransmitStatus.22_11 = Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 13>; [INV]
   else
-    goto <bb 11>; [INV]
+    goto <bb 14>; [INV]
 
-  <bb 10> :
+  <bb 13> :
   # DEBUG BEGIN_STMT
   Uart_Abort (transChannel, 0);
   # DEBUG BEGIN_STMT
   retVal = 1;
-  goto <bb 12>; [INV]
+  goto <bb 15>; [INV]
 
-  <bb 11> :
+  <bb 14> :
   # DEBUG BEGIN_STMT
   retVal = 0;
 
-  <bb 12> :
+  <bb 15> :
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 = Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 13>; [INV]
+  Uart_ReceiveStatus.23_12 = Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 16>; [INV]
   else
-    goto <bb 14>; [INV]
+    goto <bb 17>; [INV]
 
-  <bb 13> :
+  <bb 16> :
   # DEBUG BEGIN_STMT
   Uart_Abort (recvChannel, 1);
   # DEBUG BEGIN_STMT
   retVal = 1;
-  goto <bb 15>; [INV]
+  goto <bb 18>; [INV]
 
-  <bb 14> :
+  <bb 17> :
   # DEBUG BEGIN_STMT
   retVal = 0;
 
-  <bb 15> :
+  <bb 18> :
   # DEBUG BEGIN_STMT
-  D.9369 = (Std_ReturnType) retVal;
+  D.9381 = (Std_ReturnType) retVal;
 
-  <bb 16> :
+  <bb 19> :
   T_bytesRemaining = {CLOBBER};
-  return D.9369;
+  return D.9381;
 
 }
 
@@ -487,14 +533,14 @@ TestDelay (uint32 delay)
 
   <bb 3> :
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 = DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 = DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer = _2;
 
   <bb 4> :
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 = DelayTimer;
-  if (delay > DelayTimer.13_3)
+  DelayTimer.17_3 = DelayTimer;
+  if (delay > DelayTimer.17_3)
     goto <bb 3>; [INV]
   else
     goto <bb 5>; [INV]
@@ -507,12 +553,98 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  Std_ReturnType D.9376;
+
+  <bb 2> :
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  retVal = 1;
+  # DEBUG BEGIN_STMT
+  u8TimeOut = 100;
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId;
+  Hth = _1 + 1;
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo = Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth, &Can_PduInfo);
+  CAN_Write_Status = _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 = CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 4>; [INV]
+  else
+    goto <bb 6>; [INV]
+
+  <bb 3> :
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut.13_8 = u8TimeOut;
+  u8TimeOut = u8TimeOut.13_8 + 255;
+
+  <bb 4> :
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_9 = CanIf_bTxFlag;
+  _10 = ~CanIf_bTxFlag.14_9;
+  if (_10 != 0)
+    goto <bb 5>; [INV]
+  else
+    goto <bb 6>; [INV]
+
+  <bb 5> :
+  if (u8TimeOut != 0)
+    goto <bb 3>; [INV]
+  else
+    goto <bb 6>; [INV]
+
+  <bb 6> :
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_11 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_11 != 0)
+    goto <bb 7>; [INV]
+  else
+    goto <bb 8>; [INV]
+
+  <bb 7> :
+  # DEBUG BEGIN_STMT
+  retVal = 0;
+  goto <bb 9>; [INV]
+
+  <bb 8> :
+  # DEBUG BEGIN_STMT
+  retVal = 1;
+
+  <bb 9> :
+  # DEBUG BEGIN_STMT
+  D.9376 = retVal;
+  return D.9376;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
   volatile uint32 contor1;
   volatile uint32 data;
-  long unsigned int D.9366;
+  long unsigned int D.9369;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -535,9 +667,9 @@ Can_DummyDelay (uint32 loops)
   _3 = (long unsigned int) _2;
   contor2.6_4 = contor2;
   _5 = _3 | contor2.6_4;
-  D.9366 = _5 | 11184810;
+  D.9369 = _5 | 11184810;
   data.7_6 = data;
-  _7 = D.9366 ^ data.7_6;
+  _7 = D.9369 ^ data.7_6;
   data = _7;
   # DEBUG BEGIN_STMT
   contor1.8_8 = contor1;
@@ -587,8 +719,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox->CanId;
   _2 = PduInfoPtr->SduLength;
   _3 = (unsigned char) _2;
@@ -643,12 +773,12 @@ CanIf_ControllerBusOff (uint8 ControllerId)
 
 Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 {
-  struct Can_MsgType CanMsgInfo;
+  struct Can_Msg_Type CanMsgInfo;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id & 2147483647;
+  _1 = id & 1073741823;
   CanMsgInfo.id = _1;
   # DEBUG BEGIN_STMT
   _2 = id >> 30;
@@ -672,30 +802,44 @@ Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle
   <bb 2> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame) <default: <L8> [INV], case 1: <L1> [INV], case 2: <L2> [INV], case 3: <L3> [INV]>
+  switch (idFrame) <default: <L4> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV], case 3: <L3> [INV]>
 
   <bb 3> :
-<L1>:
+<L0>:
   # DEBUG BEGIN_STMT
-  id = id | 1073741824;
+  id = id & 2047;
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [INV]
+  goto <bb 8>; [INV]
 
   <bb 4> :
+<L1>:
+  # DEBUG BEGIN_STMT
+  _1 = id & 2047;
+  id = _1 | 1073741824;
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [INV]
+
+  <bb 5> :
 <L2>:
   # DEBUG BEGIN_STMT
   id = id | 2147483648;
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [INV]
+  goto <bb 8>; [INV]
 
-  <bb 5> :
+  <bb 6> :
 <L3>:
   # DEBUG BEGIN_STMT
   id = id | 3221225472;
   # DEBUG BEGIN_STMT
+  goto <bb 8>; [INV]
 
-  <bb 6> :
-<L8>:
+  <bb 7> :
+<L4>:
+  # DEBUG BEGIN_STMT
+  id = id & 2047;
+  # DEBUG BEGIN_STMT
+
+  <bb 8> :
   # DEBUG BEGIN_STMT
   PduInfo.id = id;
   # DEBUG BEGIN_STMT

+ 363 - 193
Debug_FLASH/src/main.c.022i.opt_local_passes

@@ -1,11 +1,9 @@
 main ()
 {
   uint8 u8TimeOut;
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -17,9 +15,8 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  u8TimeOut_5 = 100;
-  # DEBUG u8TimeOut => u8TimeOut_5
+  u8TimeOut_4 = 100;
+  # DEBUG u8TimeOut => u8TimeOut_4
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
   # DEBUG BEGIN_STMT
@@ -64,21 +61,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  Can_PduInfo = Can_CreatePduInfo (85, 2, 0, 8, &Can_au8Sdu8bytes);
-  # DEBUG BEGIN_STMT
   Can_SetControllerMode (0, 1);
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.id = 403846230;
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.idFrame = 2;
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.length = 8;
+  # DEBUG BEGIN_STMT
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -96,11 +96,11 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
-  long unsigned int bufferIdx.27_2;
+  long unsigned int bufferIdx.30_1;
+  long unsigned int bufferIdx.31_2;
   long unsigned int _3;
   unsigned char _4;
-  long unsigned int bufferIdx.28_5;
+  long unsigned int bufferIdx.32_5;
   uint8_t * _6;
   struct 
 {
@@ -131,7 +131,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 } * _7;
   short unsigned int _8;
   long unsigned int _9;
-  long unsigned int bufferIdx.29_10;
+  long unsigned int bufferIdx.33_10;
   long unsigned int _11;
   unsigned char _12;
 
@@ -146,21 +146,21 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> :
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [INV]
   else
     goto <bb 5>; [INV]
 
   <bb 4> :
   # DEBUG BEGIN_STMT
-  bufferIdx.27_2 = bufferIdx;
-  _3 = bufferIdx.27_2 + 20;
+  bufferIdx.31_2 = bufferIdx;
+  _3 = bufferIdx.31_2 + 20;
   bufferIdx = _3;
   # DEBUG BEGIN_STMT
   _4 = (unsigned char) hwInstance_18(D);
-  bufferIdx.28_5 = bufferIdx;
-  _6 = &RX_Buffer[hwInstance_18(D)][bufferIdx.28_5];
+  bufferIdx.32_5 = bufferIdx;
+  _6 = &RX_Buffer[hwInstance_18(D)][bufferIdx.32_5];
   Uart_SetBuffer (_4, _6, 20, 1);
 
   <bb 5> :
@@ -178,8 +178,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_20 = 20 - _9;
   # DEBUG temp => temp_20
   # DEBUG BEGIN_STMT
-  bufferIdx.29_10 = bufferIdx;
-  _11 = temp_20 + bufferIdx.29_10;
+  bufferIdx.33_10 = bufferIdx;
+  _11 = temp_20 + bufferIdx.33_10;
   bufferIdx = _11;
   # DEBUG BEGIN_STMT
   _12 = (unsigned char) hwInstance_18(D);
@@ -191,7 +191,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -201,13 +201,14 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _10;
   uint32 _30;
   uint32 _32;
+  uint32 _33;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -221,85 +222,98 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   retVal_18 = 1;
   # DEBUG retVal => retVal_18
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_19(D);
+  if (rxBuffer_19(D) == 0B)
+    goto <bb 3>; [INV]
+  else
+    goto <bb 4>; [INV]
+
+  <bb 3> :
+  # DEBUG BEGIN_STMT
+  _33 = retVal_18;
+  // predicted unlikely by early return (on trees) predictor.
+  goto <bb 12>; [INV]
+
+  <bb 4> :
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_20(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_19(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_20(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_19(D), RxBuffer_21(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_20(D), rxBuffer_19(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [INV]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 5>; [INV]
   else
-    goto <bb 4>; [INV]
+    goto <bb 6>; [INV]
 
-  <bb 3> :
+  <bb 5> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_19(D), 1);
+  Uart_Abort (recvChannel_20(D), 1);
   # DEBUG BEGIN_STMT
   _32 = 1;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 10>; [INV]
+  goto <bb 12>; [INV]
 
-  <bb 4> :
-  # timeout_8 = PHI <timeout_17(2), timeout_26(5)>
+  <bb 6> :
+  # timeout_8 = PHI <timeout_17(4), timeout_26(7)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_19(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_20(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [INV]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 7>; [INV]
   else
-    goto <bb 6>; [INV]
+    goto <bb 8>; [INV]
 
-  <bb 5> :
+  <bb 7> :
   timeout_26 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_26
   if (timeout_26 != 0)
-    goto <bb 4>; [INV]
-  else
     goto <bb 6>; [INV]
+  else
+    goto <bb 8>; [INV]
 
-  <bb 6> :
+  <bb 8> :
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [INV]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 9>; [INV]
   else
-    goto <bb 8>; [INV]
+    goto <bb 10>; [INV]
 
-  <bb 7> :
+  <bb 9> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_19(D), 1);
+  Uart_Abort (recvChannel_20(D), 1);
   # DEBUG BEGIN_STMT
   retVal_29 = 1;
   # DEBUG retVal => retVal_29
-  goto <bb 9>; [INV]
+  goto <bb 11>; [INV]
 
-  <bb 8> :
+  <bb 10> :
   # DEBUG BEGIN_STMT
   retVal_27 = 0;
   # DEBUG retVal => retVal_27
 
-  <bb 9> :
-  # retVal_9 = PHI <retVal_29(7), retVal_27(8)>
+  <bb 11> :
+  # retVal_9 = PHI <retVal_29(9), retVal_27(10)>
   # DEBUG retVal => retVal_9
   # DEBUG BEGIN_STMT
   _30 = retVal_9;
 
-  <bb 10> :
-  # _10 = PHI <_32(3), _30(9)>
+  <bb 12> :
+  # _10 = PHI <_33(3), _32(5), _30(11)>
   T_bytesRemaining ={v} {CLOBBER};
   return _10;
 
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -307,13 +321,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _29;
   Std_ReturnType _31;
+  Std_ReturnType _32;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -327,83 +342,96 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   retVal_16 = 1;
   # DEBUG retVal => retVal_16
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_17(D), pBuffer_18(D), sendLength_19(D), 0);
-  # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_17(D), pBuffer_18(D), sendLength_19(D));
-  T_Uart_Status ={v} _1;
-  # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
+  if (txBuffer_17(D) == 0B)
     goto <bb 3>; [INV]
   else
     goto <bb 4>; [INV]
 
   <bb 3> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_17(D), 0);
-  # DEBUG BEGIN_STMT
-  _31 = 1;
+  _32 = (Std_ReturnType) retVal_16;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 10>; [INV]
+  goto <bb 12>; [INV]
 
   <bb 4> :
-  # timeout_6 = PHI <timeout_15(2), timeout_25(5)>
-  # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
+  Uart_SetBuffer (transChannel_18(D), txBuffer_17(D), sendLength_19(D), 0);
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_17(D), &T_bytesRemaining, 0);
-  Uart_TransmitStatus ={v} _3;
+  _1 = Uart_AsyncSend (transChannel_18(D), txBuffer_17(D), sendLength_19(D));
+  T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
     goto <bb 5>; [INV]
   else
     goto <bb 6>; [INV]
 
   <bb 5> :
-  timeout_25 = timeout_6 + 4294967295;
-  # DEBUG timeout => timeout_25
-  if (timeout_25 != 0)
-    goto <bb 4>; [INV]
-  else
-    goto <bb 6>; [INV]
+  # DEBUG BEGIN_STMT
+  Uart_Abort (transChannel_18(D), 0);
+  # DEBUG BEGIN_STMT
+  _31 = 1;
+  // predicted unlikely by early return (on trees) predictor.
+  goto <bb 12>; [INV]
 
   <bb 6> :
+  # timeout_6 = PHI <timeout_15(4), timeout_25(7)>
+  # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
+  # DEBUG BEGIN_STMT
+  _3 = Uart_GetStatus (transChannel_18(D), &T_bytesRemaining, 0);
+  Uart_TransmitStatus ={v} _3;
+  # DEBUG BEGIN_STMT
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
     goto <bb 7>; [INV]
   else
     goto <bb 8>; [INV]
 
   <bb 7> :
+  timeout_25 = timeout_6 + 4294967295;
+  # DEBUG timeout => timeout_25
+  if (timeout_25 != 0)
+    goto <bb 6>; [INV]
+  else
+    goto <bb 8>; [INV]
+
+  <bb 8> :
+  # DEBUG BEGIN_STMT
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 9>; [INV]
+  else
+    goto <bb 10>; [INV]
+
+  <bb 9> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_17(D), 0);
+  Uart_Abort (transChannel_18(D), 0);
   # DEBUG BEGIN_STMT
   retVal_28 = 1;
   # DEBUG retVal => retVal_28
-  goto <bb 9>; [INV]
+  goto <bb 11>; [INV]
 
-  <bb 8> :
+  <bb 10> :
   # DEBUG BEGIN_STMT
   retVal_26 = 0;
   # DEBUG retVal => retVal_26
 
-  <bb 9> :
-  # retVal_7 = PHI <retVal_28(7), retVal_26(8)>
+  <bb 11> :
+  # retVal_7 = PHI <retVal_28(9), retVal_26(10)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _29 = (Std_ReturnType) retVal_7;
 
-  <bb 10> :
-  # _8 = PHI <_31(3), _29(9)>
+  <bb 12> :
+  # _8 = PHI <_32(3), _31(5), _29(11)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -415,19 +443,20 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _48;
   Std_ReturnType _50;
   Std_ReturnType _52;
+  Std_ReturnType _53;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -444,130 +473,149 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   retVal_25 = 1;
   # DEBUG retVal => retVal_25
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_26(D);
+  if (txBuffer_26(D) == 0B)
+    goto <bb 4>; [INV]
+  else
+    goto <bb 3>; [INV]
+
+  <bb 3> :
+  if (rxBuffer_27(D) == 0B)
+    goto <bb 4>; [INV]
+  else
+    goto <bb 5>; [INV]
+
+  <bb 4> :
+  # DEBUG BEGIN_STMT
+  _53 = (Std_ReturnType) retVal_25;
+  // predicted unlikely by early return (on trees) predictor.
+  goto <bb 19>; [INV]
+
+  <bb 5> :
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_28(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_28(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_26(D), RxBuffer_28(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_28(D), rxBuffer_27(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [INV]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 6>; [INV]
   else
-    goto <bb 4>; [INV]
+    goto <bb 7>; [INV]
 
-  <bb 3> :
+  <bb 6> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_26(D), 1);
+  Uart_Abort (recvChannel_28(D), 1);
   # DEBUG BEGIN_STMT
   _52 = 1;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 16>; [INV]
+  goto <bb 19>; [INV]
 
-  <bb 4> :
+  <bb 7> :
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_31(D), pBuffer_32(D), sendLength_33(D), 0);
+  Uart_SetBuffer (transChannel_32(D), txBuffer_26(D), sendLength_33(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_31(D), pBuffer_32(D), sendLength_33(D));
+  _5 = Uart_AsyncSend (transChannel_32(D), txBuffer_26(D), sendLength_33(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [INV]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 8>; [INV]
   else
-    goto <bb 6>; [INV]
+    goto <bb 9>; [INV]
 
-  <bb 5> :
+  <bb 8> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_31(D), 0);
+  Uart_Abort (transChannel_32(D), 0);
   # DEBUG BEGIN_STMT
   _50 = 1;
   // predicted unlikely by early return (on trees) predictor.
-  goto <bb 16>; [INV]
+  goto <bb 19>; [INV]
 
-  <bb 6> :
-  # timeout_13 = PHI <timeout_24(4), timeout_41(8)>
+  <bb 9> :
+  # timeout_13 = PHI <timeout_24(7), timeout_41(11)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_31(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_32(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_28(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [INV]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 10>; [INV]
   else
-    goto <bb 9>; [INV]
+    goto <bb 12>; [INV]
 
-  <bb 7> :
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [INV]
+  <bb 10> :
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 11>; [INV]
   else
-    goto <bb 9>; [INV]
+    goto <bb 12>; [INV]
 
-  <bb 8> :
+  <bb 11> :
   timeout_41 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_41
   if (timeout_41 != 0)
-    goto <bb 6>; [INV]
-  else
     goto <bb 9>; [INV]
+  else
+    goto <bb 12>; [INV]
 
-  <bb 9> :
+  <bb 12> :
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [INV]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 13>; [INV]
   else
-    goto <bb 11>; [INV]
+    goto <bb 14>; [INV]
 
-  <bb 10> :
+  <bb 13> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_31(D), 0);
+  Uart_Abort (transChannel_32(D), 0);
   # DEBUG BEGIN_STMT
   retVal_44 = 1;
   # DEBUG retVal => retVal_44
-  goto <bb 12>; [INV]
+  goto <bb 15>; [INV]
 
-  <bb 11> :
+  <bb 14> :
   # DEBUG BEGIN_STMT
   retVal_42 = 0;
   # DEBUG retVal => retVal_42
 
-  <bb 12> :
+  <bb 15> :
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 13>; [INV]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 16>; [INV]
   else
-    goto <bb 14>; [INV]
+    goto <bb 17>; [INV]
 
-  <bb 13> :
+  <bb 16> :
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_26(D), 1);
+  Uart_Abort (recvChannel_28(D), 1);
   # DEBUG BEGIN_STMT
   retVal_47 = 1;
   # DEBUG retVal => retVal_47
-  goto <bb 15>; [INV]
+  goto <bb 18>; [INV]
 
-  <bb 14> :
+  <bb 17> :
   # DEBUG BEGIN_STMT
   retVal_45 = 0;
   # DEBUG retVal => retVal_45
 
-  <bb 15> :
-  # retVal_14 = PHI <retVal_47(13), retVal_45(14)>
+  <bb 18> :
+  # retVal_14 = PHI <retVal_47(16), retVal_45(17)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _48 = (Std_ReturnType) retVal_14;
 
-  <bb 16> :
-  # _15 = PHI <_52(3), _50(5), _48(15)>
+  <bb 19> :
+  # _15 = PHI <_53(4), _52(6), _50(8), _48(18)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -577,9 +625,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
@@ -588,14 +636,14 @@ TestDelay (uint32 delay)
 
   <bb 3> :
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> :
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (delay_6(D) > DelayTimer.13_3)
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (delay_6(D) > DelayTimer.17_3)
     goto <bb 3>; [INV]
   else
     goto <bb 5>; [INV]
@@ -608,6 +656,113 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  unsigned char u8TimeOut.13_8;
+  _Bool CanIf_bTxFlag.14_9;
+  _Bool _10;
+  _Bool CanIf_bTxFlag.15_11;
+  Std_ReturnType _30;
+
+  <bb 2> :
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  retVal_16 = 1;
+  # DEBUG retVal => retVal_16
+  # DEBUG BEGIN_STMT
+  u8TimeOut_17 = 100;
+  # DEBUG u8TimeOut => u8TimeOut_17
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_18(D);
+  Hth_19 = _1 + 1;
+  # DEBUG Hth => Hth_19
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_19, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 4>; [INV]
+  else
+    goto <bb 6>; [INV]
+
+  <bb 3> :
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut.13_8 = u8TimeOut_13;
+  u8TimeOut_27 = u8TimeOut.13_8 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_27
+
+  <bb 4> :
+  # u8TimeOut_13 = PHI <u8TimeOut_17(2), u8TimeOut_27(3)>
+  # DEBUG u8TimeOut => u8TimeOut_13
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_9 = CanIf_bTxFlag;
+  _10 = ~CanIf_bTxFlag.14_9;
+  if (_10 != 0)
+    goto <bb 5>; [INV]
+  else
+    goto <bb 6>; [INV]
+
+  <bb 5> :
+  if (u8TimeOut_13 != 0)
+    goto <bb 3>; [INV]
+  else
+    goto <bb 6>; [INV]
+
+  <bb 6> :
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_11 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_11 != 0)
+    goto <bb 7>; [INV]
+  else
+    goto <bb 8>; [INV]
+
+  <bb 7> :
+  # DEBUG BEGIN_STMT
+  retVal_29 = 0;
+  # DEBUG retVal => retVal_29
+  goto <bb 9>; [INV]
+
+  <bb 8> :
+  # DEBUG BEGIN_STMT
+  retVal_28 = 1;
+  # DEBUG retVal => retVal_28
+
+  <bb 9> :
+  # retVal_12 = PHI <retVal_29(7), retVal_28(8)>
+  # DEBUG retVal => retVal_12
+  # DEBUG BEGIN_STMT
+  _30 = retVal_12;
+  return _30;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -711,8 +866,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_12(D)->CanId;
   _2 = PduInfoPtr_13(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -771,14 +924,14 @@ CanIf_ControllerBusOff (uint8 ControllerId)
 
 Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 {
-  struct Can_MsgType CanMsgInfo;
+  struct Can_Msg_Type CanMsgInfo;
   long unsigned int _1;
   long unsigned int _2;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   CanMsgInfo.id = _1;
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -798,47 +951,64 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
   struct Can_PduType PduInfo;
+  long unsigned int _1;
 
   <bb 2> :
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [INV], case 1: <L1> [INV], case 2: <L2> [INV], case 3: <L3> [INV]>
+  switch (idFrame_3(D)) <default: <L4> [INV], case 0: <L0> [INV], case 1: <L1> [INV], case 2: <L2> [INV], case 3: <L3> [INV]>
 
   <bb 3> :
-<L1>:
+<L0>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [INV]
+  goto <bb 8>; [INV]
 
   <bb 4> :
-<L2>:
+<L1>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [INV]
+  goto <bb 8>; [INV]
 
   <bb 5> :
-<L3>:
+<L2>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
+  id_6 = id_4(D) | 2147483648;
   # DEBUG id => id_6
   # DEBUG BEGIN_STMT
+  goto <bb 8>; [INV]
 
   <bb 6> :
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+<L3>:
+  # DEBUG BEGIN_STMT
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [INV]
+
+  <bb 7> :
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
+  # DEBUG BEGIN_STMT
+
+  <bb 8> :
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  PduInfo.id = id_1;
+  PduInfo.id = id_2;
   # DEBUG BEGIN_STMT
-  PduInfo.swPduHandle = swPduHandle_9(D);
+  PduInfo.swPduHandle = swPduHandle_12(D);
   # DEBUG BEGIN_STMT
-  PduInfo.length = length_11(D);
+  PduInfo.length = length_14(D);
   # DEBUG BEGIN_STMT
-  PduInfo.sdu = sdu_13(D);
+  PduInfo.sdu = sdu_16(D);
   # DEBUG BEGIN_STMT
   <retval> = PduInfo;
   PduInfo ={v} {CLOBBER};

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 239 - 253
Debug_FLASH/src/main.c.048i.remove_symbols


+ 322 - 221
Debug_FLASH/src/main.c.060i.targetclone

@@ -1,10 +1,8 @@
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -16,7 +14,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -62,58 +59,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -133,13 +96,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -154,15 +117,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -183,8 +146,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -196,7 +159,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -205,13 +168,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -221,63 +184,70 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 4>; [79.76%]
+    goto <bb 5>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(2), timeout_22(5)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(3), timeout_22(6)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 4>; [94.50%]
+    goto <bb 5>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -285,7 +255,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -293,14 +263,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -310,74 +280,81 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 4>; [79.76%]
+    goto <bb 5>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(2), timeout_23(5)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(3), timeout_23(6)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 4>; [94.50%]
+    goto <bb 5>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -389,19 +366,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -414,113 +391,126 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 6>; [79.76%]
+    goto <bb 8>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(4), timeout_39(8)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(6), timeout_39(10)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 6>; [96.34%]
+    goto <bb 8>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -530,9 +520,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -541,14 +531,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -561,6 +551,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -659,7 +744,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -668,8 +753,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -682,7 +765,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -761,7 +844,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -790,51 +873,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
+
+  <bb 3> [local count: 214748364]:
+<L0>:
   # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  goto <bb 8>; [100.00%]
 
-  <bb 3> [local count: 268435456]:
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

+ 322 - 221
Debug_FLASH/src/main.c.064i.free-fnsummary1

@@ -1,10 +1,8 @@
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -16,7 +14,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -62,58 +59,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -133,13 +96,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -154,15 +117,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -183,8 +146,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -196,7 +159,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -205,13 +168,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -221,63 +184,70 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 4>; [79.76%]
+    goto <bb 5>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(2), timeout_22(5)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(3), timeout_22(6)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 4>; [94.50%]
+    goto <bb 5>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -285,7 +255,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -293,14 +263,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -310,74 +280,81 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 4>; [79.76%]
+    goto <bb 5>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(2), timeout_23(5)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(3), timeout_23(6)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 4>; [94.50%]
+    goto <bb 5>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -389,19 +366,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -414,113 +391,126 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 6>; [79.76%]
+    goto <bb 8>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(4), timeout_39(8)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(6), timeout_39(10)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 6>; [96.34%]
+    goto <bb 8>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -530,9 +520,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -541,14 +531,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -561,6 +551,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -659,7 +744,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -668,8 +753,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -682,7 +765,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -761,7 +844,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -790,51 +873,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
+
+  <bb 3> [local count: 214748364]:
+<L0>:
   # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  goto <bb 8>; [100.00%]
 
-  <bb 3> [local count: 268435456]:
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 246 - 260
Debug_FLASH/src/main.c.068i.whole-program


+ 331 - 230
Debug_FLASH/src/main.c.069i.profile_estimate

@@ -1,11 +1,9 @@
 Histogram:
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -17,7 +15,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -63,58 +60,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -134,13 +97,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -155,15 +118,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -184,8 +147,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -197,7 +160,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -206,13 +169,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -222,68 +185,75 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 9>; [79.76%]
+    goto <bb 10>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 9> [local count: 114863532]:
+  <bb 10> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(9), timeout_22(10)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(10), timeout_22(11)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 10>; [94.50%]
+    goto <bb 11>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 10> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 11> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -291,7 +261,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -299,14 +269,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -316,79 +286,86 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
+  # DEBUG BEGIN_STMT
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 10>; [79.76%]
+    goto <bb 11>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 10> [local count: 114863532]:
+  <bb 11> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(10), timeout_23(11)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(11), timeout_23(12)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 11>; [94.50%]
+    goto <bb 12>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 11> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 12> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -400,19 +377,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -425,118 +402,131 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 15>; [79.76%]
+    goto <bb 17>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 15> [local count: 113634471]:
+  <bb 17> [local count: 113634470]:
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(15), timeout_39(16)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(17), timeout_39(18)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 16>; [96.34%]
+    goto <bb 18>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 16> [local count: 960107353]:
-  goto <bb 6>; [100.00%]
+  <bb 18> [local count: 960107353]:
+  goto <bb 8>; [100.00%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -546,9 +536,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -557,14 +547,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -577,6 +567,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -675,7 +760,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -684,8 +769,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -698,7 +781,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -777,7 +860,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -806,51 +889,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
 
-  <bb 3> [local count: 268435456]:
+  <bb 3> [local count: 214748364]:
+<L0>:
+  # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

+ 346 - 244
Debug_FLASH/src/main.c.070i.icf

@@ -4,6 +4,7 @@ Parsed function:UART_Receive_Data
 Parsed function:UART_Send_Data
 Parsed function:UART_Query_Data
 Parsed function:TestDelay
+Parsed function:CanIf_SendMessage
 Parsed function:Can_DummyDelay
 Parsed function:CanIf_CurrentIcomConfiguration
 Parsed function:CanIf_RxIndication
@@ -13,42 +14,42 @@ Parsed function:CanIf_ControllerBusOff
 Parsed function:Can_GetMsgInfo
 Parsed function:Can_CreatePduInfo
 Dump after hash based groups
-Congruence classes: 14 (unique hash values: 14), with total: 14 items
+Congruence classes: 15 (unique hash values: 15), with total: 15 items
 Class size histogram [num of members]: number of classe number of classess
-[1]: 14 classes
+[1]: 15 classes
 
 
 Dump after WPA based types groups
-Congruence classes: 14 (unique hash values: 14), with total: 14 items
+Congruence classes: 15 (unique hash values: 15), with total: 15 items
 Class size histogram [num of members]: number of classe number of classess
-[1]: 14 classes
+[1]: 15 classes
 
 
-Worklist has been filled with: 1
+Worklist has been filled with: 4
 Address reference subdivision created: 0 new classes.
 Dump after callgraph-based congruence reduction
-Congruence classes: 14 (unique hash values: 14), with total: 14 items
+Congruence classes: 15 (unique hash values: 15), with total: 15 items
 Class size histogram [num of members]: number of classe number of classess
-[1]: 14 classes
+[1]: 15 classes
 
 
 Init called for 0 items (0.00%).
 Dump after full equality comparison of groups
-Congruence classes: 14 (unique hash values: 14), with total: 14 items
+Congruence classes: 15 (unique hash values: 15), with total: 15 items
 Class size histogram [num of members]: number of classe number of classess
-[1]: 14 classes
+[1]: 15 classes
 
 
-Worklist has been filled with: 1
+Worklist has been filled with: 4
 Address reference subdivision created: 0 new classes.
-Congruence classes: 14 (unique hash values: 14), with total: 14 items
+Congruence classes: 15 (unique hash values: 15), with total: 15 items
 Class size histogram [num of members]: number of classe number of classess
-[1]: 14 classes
+[1]: 15 classes
 
 
 
-Item count: 14
-Congruent classes before: 14, after: 14
+Item count: 15
+Congruent classes before: 15, after: 15
 Average class size before: 1.00, after: 1.00
 Average non-singular class size: 0.00, count: 0
 Equal symbols: 0
@@ -56,11 +57,9 @@ Fraction of visited symbols: 0.00%
 
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -72,7 +71,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -118,58 +116,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -189,13 +153,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -210,15 +174,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -239,8 +203,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -252,7 +216,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -261,13 +225,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -277,68 +241,75 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 9>; [79.76%]
+    goto <bb 10>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 9> [local count: 114863532]:
+  <bb 10> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(9), timeout_22(10)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(10), timeout_22(11)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 10>; [94.50%]
+    goto <bb 11>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 10> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 11> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -346,7 +317,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -354,14 +325,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -371,79 +342,86 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
+  # DEBUG BEGIN_STMT
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 10>; [79.76%]
+    goto <bb 11>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 10> [local count: 114863532]:
+  <bb 11> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(10), timeout_23(11)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(11), timeout_23(12)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 11>; [94.50%]
+    goto <bb 12>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 11> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 12> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -455,19 +433,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -480,118 +458,131 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 15>; [79.76%]
+    goto <bb 17>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 15> [local count: 113634471]:
+  <bb 17> [local count: 113634470]:
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(15), timeout_39(16)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(17), timeout_39(18)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 16>; [96.34%]
+    goto <bb 18>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 16> [local count: 960107353]:
-  goto <bb 6>; [100.00%]
+  <bb 18> [local count: 960107353]:
+  goto <bb 8>; [100.00%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -601,9 +592,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -612,14 +603,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -632,6 +623,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -730,7 +816,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -739,8 +825,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -753,7 +837,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -832,7 +916,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -861,51 +945,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
 
-  <bb 3> [local count: 268435456]:
+  <bb 3> [local count: 214748364]:
+<L0>:
+  # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 245 - 259
Debug_FLASH/src/main.c.071i.devirt


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 287 - 217
Debug_FLASH/src/main.c.072i.cp


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 374 - 273
Debug_FLASH/src/main.c.075i.fnsummary


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 438 - 359
Debug_FLASH/src/main.c.076i.inline


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 285 - 235
Debug_FLASH/src/main.c.077i.pure-const


+ 331 - 230
Debug_FLASH/src/main.c.078i.free-fnsummary2

@@ -1,10 +1,8 @@
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -16,7 +14,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -62,58 +59,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -133,13 +96,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -154,15 +117,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -183,8 +146,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -196,7 +159,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -205,13 +168,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -221,68 +184,75 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 9>; [79.76%]
+    goto <bb 10>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 9> [local count: 114863532]:
+  <bb 10> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(9), timeout_22(10)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(10), timeout_22(11)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 10>; [94.50%]
+    goto <bb 11>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 10> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 11> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -290,7 +260,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -298,14 +268,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -315,79 +285,86 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
+  # DEBUG BEGIN_STMT
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 10>; [79.76%]
+    goto <bb 11>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 10> [local count: 114863532]:
+  <bb 11> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(10), timeout_23(11)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(11), timeout_23(12)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 11>; [94.50%]
+    goto <bb 12>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 11> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 12> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -399,19 +376,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -424,118 +401,131 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 15>; [79.76%]
+    goto <bb 17>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 15> [local count: 113634471]:
+  <bb 17> [local count: 113634470]:
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(15), timeout_39(16)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(17), timeout_39(18)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 16>; [96.34%]
+    goto <bb 18>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 16> [local count: 960107353]:
-  goto <bb 6>; [100.00%]
+  <bb 18> [local count: 960107353]:
+  goto <bb 8>; [100.00%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -545,9 +535,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -556,14 +546,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -576,6 +566,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -674,7 +759,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -683,8 +768,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -697,7 +780,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -776,7 +859,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -805,51 +888,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
 
-  <bb 3> [local count: 268435456]:
+  <bb 3> [local count: 214748364]:
+<L0>:
+  # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 216 - 223
Debug_FLASH/src/main.c.079i.static-var


+ 332 - 231
Debug_FLASH/src/main.c.080i.single-use

@@ -1,11 +1,9 @@
-Variable Can_PduInfo/88 is used by single function
+Variable Can_MsgInfo/85 is used by single function
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -17,7 +15,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -63,58 +60,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -134,13 +97,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -155,15 +118,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -184,8 +147,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -197,7 +160,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -206,13 +169,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -222,68 +185,75 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 9>; [79.76%]
+    goto <bb 10>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 9> [local count: 114863532]:
+  <bb 10> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(9), timeout_22(10)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(10), timeout_22(11)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 10>; [94.50%]
+    goto <bb 11>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 10> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 11> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -291,7 +261,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -299,14 +269,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -316,79 +286,86 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
+  # DEBUG BEGIN_STMT
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 10>; [79.76%]
+    goto <bb 11>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 10> [local count: 114863532]:
+  <bb 11> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(10), timeout_23(11)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(11), timeout_23(12)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 11>; [94.50%]
+    goto <bb 12>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 11> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 12> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -400,19 +377,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -425,118 +402,131 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 15>; [79.76%]
+    goto <bb 17>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 15> [local count: 113634471]:
+  <bb 17> [local count: 113634470]:
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(15), timeout_39(16)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(17), timeout_39(18)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 16>; [96.34%]
+    goto <bb 18>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 16> [local count: 960107353]:
-  goto <bb 6>; [100.00%]
+  <bb 18> [local count: 960107353]:
+  goto <bb 8>; [100.00%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -546,9 +536,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -557,14 +547,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -577,6 +567,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -675,7 +760,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -684,8 +769,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -698,7 +781,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -777,7 +860,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -806,51 +889,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
 
-  <bb 3> [local count: 268435456]:
+  <bb 3> [local count: 214748364]:
+<L0>:
+  # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

+ 331 - 230
Debug_FLASH/src/main.c.081i.comdats

@@ -1,10 +1,8 @@
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -16,7 +14,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -62,58 +59,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -133,13 +96,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -154,15 +117,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -183,8 +146,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -196,7 +159,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -205,13 +168,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -221,68 +184,75 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 9>; [79.76%]
+    goto <bb 10>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 9> [local count: 114863532]:
+  <bb 10> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(9), timeout_22(10)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(10), timeout_22(11)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 10>; [94.50%]
+    goto <bb 11>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 10> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 11> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -290,7 +260,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -298,14 +268,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -315,79 +285,86 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
+  # DEBUG BEGIN_STMT
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 10>; [79.76%]
+    goto <bb 11>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 10> [local count: 114863532]:
+  <bb 11> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(10), timeout_23(11)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(11), timeout_23(12)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 11>; [94.50%]
+    goto <bb 12>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 11> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 12> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -399,19 +376,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -424,118 +401,131 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 15>; [79.76%]
+    goto <bb 17>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 15> [local count: 113634471]:
+  <bb 17> [local count: 113634470]:
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(15), timeout_39(16)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(17), timeout_39(18)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 16>; [96.34%]
+    goto <bb 18>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 16> [local count: 960107353]:
-  goto <bb 6>; [100.00%]
+  <bb 18> [local count: 960107353]:
+  goto <bb 8>; [100.00%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -545,9 +535,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -556,14 +546,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -576,6 +566,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -674,7 +759,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -683,8 +768,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -697,7 +780,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -776,7 +859,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -805,51 +888,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
 
-  <bb 3> [local count: 268435456]:
+  <bb 3> [local count: 214748364]:
+<L0>:
+  # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

+ 331 - 230
Debug_FLASH/src/main.c.082i.materialize-all-clones

@@ -1,10 +1,8 @@
 main ()
 {
-  volatile Std_ReturnType CAN_Write_Status;
-  static struct Can_PduType Can_PduInfo;
-  unsigned char pinValue.30_1;
+  static struct Can_Msg_Type Can_MsgInfo;
+  unsigned char pinValue.34_1;
   unsigned char _2;
-  unsigned char _3;
 
   <bb 2> [local count: 107374]:
   # DEBUG BEGIN_STMT
@@ -16,7 +14,6 @@ main ()
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   # DEBUG u8TimeOut => 100
   # DEBUG BEGIN_STMT
   CanIf_bTxFlag = 0;
@@ -62,58 +59,24 @@ main ()
   # DEBUG BEGIN_STMT
   Can_Init (0B);
   # DEBUG BEGIN_STMT
-  # DEBUG id => 85
-  # DEBUG idFrame => 2
-  # DEBUG swPduHandle => 0
-  # DEBUG length => 8
-  # DEBUG sdu => &Can_au8Sdu8bytes
-  # DEBUG INLINE_ENTRY NULL
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG id => 2147483733
-  # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => 2147483733
+  Can_SetControllerMode (0, 1);
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => 0
+  Can_MsgInfo.id = 403846230;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => 8
+  Can_MsgInfo.idFrame = 2;
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => &Can_au8Sdu8bytes
+  Can_MsgInfo.length = 8;
   # DEBUG BEGIN_STMT
-  # DEBUG D#1 => {CLOBBER}
-  # DEBUG PduInfo$id => D#1
-  # DEBUG D#2 => {CLOBBER}
-  # DEBUG PduInfo$swPduHandle => D#2
-  # DEBUG D#3 => {CLOBBER}
-  # DEBUG PduInfo$length => D#3
-  # DEBUG D#4 => {CLOBBER}
-  # DEBUG PduInfo$sdu => D#4
-  # DEBUG id => NULL
-  # DEBUG idFrame => NULL
-  # DEBUG swPduHandle => NULL
-  # DEBUG length => NULL
-  # DEBUG sdu => NULL
-  MEM[(struct  *)&Can_PduInfo] = 2147483733;
-  MEM[(struct  *)&Can_PduInfo + 4B] = 0;
-  MEM[(struct  *)&Can_PduInfo + 6B] = 8;
-  MEM[(struct  *)&Can_PduInfo + 8B] = &Can_au8Sdu8bytes;
-  # DEBUG BEGIN_STMT
-  Can_SetControllerMode (0, 1);
+  Can_MsgInfo.sdu = &Can_au8Sdu8bytes;
 
   <bb 3> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  pinValue.30_1 ={v} pinValue;
-  _2 = ~pinValue.30_1;
+  pinValue.34_1 ={v} pinValue;
+  _2 = ~pinValue.34_1;
   pinValue ={v} _2;
   # DEBUG BEGIN_STMT
-  _3 = Can_Write (1, &Can_PduInfo);
-  CAN_Write_Status ={v} _3;
-  # DEBUG BEGIN_STMT
-  Can_MainFunction_Write ();
+  CanIf_SendMessage (0, Can_MsgInfo);
   # DEBUG BEGIN_STMT
   TestDelay (100000);
   # DEBUG BEGIN_STMT
@@ -133,13 +96,13 @@ main ()
 UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userData)
 {
   uint32_t temp;
-  long unsigned int bufferIdx.26_1;
+  long unsigned int bufferIdx.30_1;
   long unsigned int _2;
   unsigned char _3;
   uint8_t * _4;
   short unsigned int _5;
   long unsigned int _6;
-  long unsigned int bufferIdx.29_7;
+  long unsigned int bufferIdx.33_7;
   long unsigned int _8;
   unsigned char _9;
 
@@ -154,15 +117,15 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 
   <bb 3> [local count: 536870913]:
   # DEBUG BEGIN_STMT
-  bufferIdx.26_1 = bufferIdx;
-  if (bufferIdx.26_1 <= 480)
+  bufferIdx.30_1 = bufferIdx;
+  if (bufferIdx.30_1 <= 480)
     goto <bb 4>; [33.00%]
   else
     goto <bb 5>; [67.00%]
 
   <bb 4> [local count: 177167401]:
   # DEBUG BEGIN_STMT
-  _2 = bufferIdx.26_1 + 20;
+  _2 = bufferIdx.30_1 + 20;
   bufferIdx = _2;
   # DEBUG BEGIN_STMT
   _3 = (unsigned char) hwInstance_15(D);
@@ -183,8 +146,8 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
   temp_17 = 20 - _6;
   # DEBUG temp => temp_17
   # DEBUG BEGIN_STMT
-  bufferIdx.29_7 = bufferIdx;
-  _8 = bufferIdx.29_7 + temp_17;
+  bufferIdx.33_7 = bufferIdx;
+  _8 = bufferIdx.33_7 + temp_17;
   bufferIdx = _8;
   # DEBUG BEGIN_STMT
   _9 = (unsigned char) hwInstance_15(D);
@@ -196,7 +159,7 @@ UART_Callback (uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void * userDat
 }
 
 
-UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
+UART_Receive_Data (uint8 recvChannel, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 timeout;
   uint32 T_bytesRemaining;
@@ -205,13 +168,13 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char R_Uart_Status.23_4;
+  unsigned char R_Uart_Status.27_4;
   <unnamed type> _5;
-  <unnamed type> Uart_ReceiveStatus.24_6;
-  <unnamed type> Uart_ReceiveStatus.25_7;
+  <unnamed type> Uart_ReceiveStatus.28_6;
+  <unnamed type> Uart_ReceiveStatus.29_7;
   uint32 _9;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_ReceiveStatus ={v} 6;
@@ -221,68 +184,75 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_15(D);
+  if (rxBuffer_15(D) == 0B)
+    goto <bb 9>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_16(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_15(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_16(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_15(D), RxBuffer_17(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_16(D), rxBuffer_15(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  R_Uart_Status.23_4 ={v} R_Uart_Status;
-  if (R_Uart_Status.23_4 != 0)
-    goto <bb 3>; [20.24%]
+  R_Uart_Status.27_4 ={v} R_Uart_Status;
+  if (R_Uart_Status.27_4 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 9>; [79.76%]
+    goto <bb 10>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 8>; [100.00%]
+  goto <bb 9>; [100.00%]
 
-  <bb 9> [local count: 114863532]:
+  <bb 10> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_8 = PHI <T_timeout_14(D)(9), timeout_22(10)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_8 = PHI <T_timeout_14(D)(10), timeout_22(11)>
   # DEBUG timeout => timeout_8
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _5 = Uart_GetStatus (recvChannel_15(D), &T_bytesRemaining, 1);
+  _5 = Uart_GetStatus (recvChannel_16(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _5;
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.24_6 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.24_6 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_ReceiveStatus.28_6 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.28_6 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_22 = timeout_8 + 4294967295;
   # DEBUG timeout => timeout_22
   if (timeout_22 != 0)
-    goto <bb 10>; [94.50%]
+    goto <bb 11>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 10> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 11> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.25_7 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.25_7 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_ReceiveStatus.29_7 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.29_7 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_15(D), 1);
+  Uart_Abort (recvChannel_16(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 144011449]:
-  # _9 = PHI <1(3), 0(6), 1(7)>
+  <bb 9> [local count: 208561114]:
+  # _9 = PHI <1(2), 1(4), 0(7), 1(8)>
   # DEBUG retVal => NULL
   T_bytesRemaining ={v} {CLOBBER};
   return _9;
@@ -290,7 +260,7 @@ UART_Receive_Data (uint8 recvChannel, uint8 * RxBuffer, uint32 T_timeout)
 }
 
 
-UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, uint32 T_timeout)
+UART_Send_Data (uint8 transChannel, const uint8 * txBuffer, uint32 sendLength, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -298,14 +268,14 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   volatile Uart_StatusType Uart_TransmitStatus;
   volatile Std_ReturnType T_Uart_Status;
   unsigned char _1;
-  unsigned char T_Uart_Status.20_2;
+  unsigned char T_Uart_Status.24_2;
   <unnamed type> _3;
-  <unnamed type> Uart_TransmitStatus.21_4;
-  <unnamed type> Uart_TransmitStatus.22_5;
+  <unnamed type> Uart_TransmitStatus.25_4;
+  <unnamed type> Uart_TransmitStatus.26_5;
   Std_ReturnType _8;
   Std_ReturnType _25;
 
-  <bb 2> [local count: 144011449]:
+  <bb 2> [local count: 208561115]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   Uart_TransmitStatus ={v} 6;
@@ -315,79 +285,86 @@ UART_Send_Data (uint8 transChannel, const uint8 * pBuffer, uint32 sendLength, ui
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_15(D), pBuffer_16(D), sendLength_17(D), 0);
+  if (txBuffer_15(D) == 0B)
+    goto <bb 10>; [30.95%]
+  else
+    goto <bb 3>; [69.05%]
+
+  <bb 3> [local count: 144011450]:
   # DEBUG BEGIN_STMT
-  _1 = Uart_AsyncSend (transChannel_15(D), pBuffer_16(D), sendLength_17(D));
+  Uart_SetBuffer (transChannel_16(D), txBuffer_15(D), sendLength_17(D), 0);
+  # DEBUG BEGIN_STMT
+  _1 = Uart_AsyncSend (transChannel_16(D), txBuffer_15(D), sendLength_17(D));
   T_Uart_Status ={v} _1;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.20_2 ={v} T_Uart_Status;
-  if (T_Uart_Status.20_2 != 0)
-    goto <bb 3>; [20.24%]
+  T_Uart_Status.24_2 ={v} T_Uart_Status;
+  if (T_Uart_Status.24_2 != 0)
+    goto <bb 4>; [20.24%]
   else
-    goto <bb 10>; [79.76%]
+    goto <bb 11>; [79.76%]
 
-  <bb 3> [local count: 29147917]:
+  <bb 4> [local count: 29147917]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 9>; [100.00%]
+  goto <bb 10>; [100.00%]
 
-  <bb 10> [local count: 114863532]:
+  <bb 11> [local count: 114863533]:
 
-  <bb 4> [local count: 1073741824]:
-  # timeout_6 = PHI <T_timeout_14(D)(10), timeout_23(11)>
+  <bb 5> [local count: 1073741824]:
+  # timeout_6 = PHI <T_timeout_14(D)(11), timeout_23(12)>
   # DEBUG timeout => timeout_6
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _3 = Uart_GetStatus (transChannel_15(D), &T_bytesRemaining, 0);
+  _3 = Uart_GetStatus (transChannel_16(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _3;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.21_4 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.21_4 != 0)
-    goto <bb 5>; [94.50%]
+  Uart_TransmitStatus.25_4 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.25_4 != 0)
+    goto <bb 6>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 5> [local count: 1014686024]:
+  <bb 6> [local count: 1014686025]:
   timeout_23 = timeout_6 + 4294967295;
   # DEBUG timeout => timeout_23
   if (timeout_23 != 0)
-    goto <bb 11>; [94.50%]
+    goto <bb 12>; [94.50%]
   else
-    goto <bb 6>; [5.50%]
+    goto <bb 7>; [5.50%]
 
-  <bb 11> [local count: 958878293]:
-  goto <bb 4>; [100.00%]
+  <bb 12> [local count: 958878294]:
+  goto <bb 5>; [100.00%]
 
-  <bb 6> [local count: 114863532]:
+  <bb 7> [local count: 114863532]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.22_5 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.22_5 != 0)
-    goto <bb 7>; [33.00%]
+  Uart_TransmitStatus.26_5 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.26_5 != 0)
+    goto <bb 8>; [33.00%]
   else
-    goto <bb 8>; [67.00%]
+    goto <bb 9>; [67.00%]
 
-  <bb 7> [local count: 37904965]:
+  <bb 8> [local count: 37904965]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_15(D), 0);
+  Uart_Abort (transChannel_16(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 8> [local count: 114863532]:
-  # retVal_7 = PHI <1(7), 0(6)>
+  <bb 9> [local count: 114863532]:
+  # retVal_7 = PHI <1(8), 0(7)>
   # DEBUG retVal => retVal_7
   # DEBUG BEGIN_STMT
   _25 = (Std_ReturnType) retVal_7;
 
-  <bb 9> [local count: 144011449]:
-  # _8 = PHI <1(3), _25(8)>
+  <bb 10> [local count: 208561114]:
+  # _8 = PHI <1(2), 1(4), _25(9)>
   T_bytesRemaining ={v} {CLOBBER};
   return _8;
 
 }
 
 
-UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, uint32 sendLength, uint8 * RxBuffer, uint32 T_timeout)
+UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * txBuffer, uint32 sendLength, uint8 * rxBuffer, uint32 T_timeout)
 {
   uint32 retVal;
   uint32 timeout;
@@ -399,19 +376,19 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   int _1;
   uint8_t * _2;
   unsigned char _3;
-  unsigned char T_Uart_Status.14_4;
+  unsigned char T_Uart_Status.18_4;
   unsigned char _5;
-  unsigned char T_Uart_Status.15_6;
+  unsigned char T_Uart_Status.19_6;
   <unnamed type> _7;
   <unnamed type> _8;
-  <unnamed type> Uart_TransmitStatus.16_9;
-  <unnamed type> Uart_ReceiveStatus.17_10;
-  <unnamed type> Uart_TransmitStatus.18_11;
-  <unnamed type> Uart_ReceiveStatus.19_12;
+  <unnamed type> Uart_TransmitStatus.20_9;
+  <unnamed type> Uart_ReceiveStatus.21_10;
+  <unnamed type> Uart_TransmitStatus.22_11;
+  <unnamed type> Uart_ReceiveStatus.23_12;
   Std_ReturnType _15;
   Std_ReturnType _42;
 
-  <bb 2> [local count: 215864393]:
+  <bb 2> [local count: 381663300]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
@@ -424,118 +401,131 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
   # DEBUG BEGIN_STMT
-  _1 = (int) recvChannel_24(D);
+  if (txBuffer_24(D) == 0B)
+    goto <bb 16>; [18.09%]
+  else
+    goto <bb 3>; [81.91%]
+
+  <bb 3> [local count: 312620409]:
+  if (rxBuffer_25(D) == 0B)
+    goto <bb 16>; [30.95%]
+  else
+    goto <bb 4>; [69.05%]
+
+  <bb 4> [local count: 215864392]:
+  # DEBUG BEGIN_STMT
+  _1 = (int) recvChannel_26(D);
   _2 = &RX_Buffer[_1][0];
-  Uart_SetBuffer (recvChannel_24(D), _2, 20, 1);
+  Uart_SetBuffer (recvChannel_26(D), _2, 20, 1);
   # DEBUG BEGIN_STMT
-  _3 = Uart_AsyncReceive (recvChannel_24(D), RxBuffer_26(D), 20);
+  _3 = Uart_AsyncReceive (recvChannel_26(D), rxBuffer_25(D), 20);
   R_Uart_Status ={v} _3;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.14_4 ={v} T_Uart_Status;
-  if (T_Uart_Status.14_4 != 0)
-    goto <bb 3>; [34.00%]
+  T_Uart_Status.18_4 ={v} T_Uart_Status;
+  if (T_Uart_Status.18_4 != 0)
+    goto <bb 5>; [34.00%]
   else
-    goto <bb 4>; [66.00%]
+    goto <bb 6>; [66.00%]
 
-  <bb 3> [local count: 73393894]:
+  <bb 5> [local count: 73393893]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 4> [local count: 142470500]:
+  <bb 6> [local count: 142470499]:
   # DEBUG BEGIN_STMT
-  Uart_SetBuffer (transChannel_29(D), pBuffer_30(D), sendLength_31(D), 0);
+  Uart_SetBuffer (transChannel_30(D), txBuffer_24(D), sendLength_31(D), 0);
   # DEBUG BEGIN_STMT
-  _5 = Uart_AsyncSend (transChannel_29(D), pBuffer_30(D), sendLength_31(D));
+  _5 = Uart_AsyncSend (transChannel_30(D), txBuffer_24(D), sendLength_31(D));
   T_Uart_Status ={v} _5;
   # DEBUG BEGIN_STMT
-  T_Uart_Status.15_6 ={v} T_Uart_Status;
-  if (T_Uart_Status.15_6 != 0)
-    goto <bb 5>; [20.24%]
+  T_Uart_Status.19_6 ={v} T_Uart_Status;
+  if (T_Uart_Status.19_6 != 0)
+    goto <bb 7>; [20.24%]
   else
-    goto <bb 15>; [79.76%]
+    goto <bb 17>; [79.76%]
 
-  <bb 5> [local count: 28836029]:
+  <bb 7> [local count: 28836029]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
-  goto <bb 14>; [100.00%]
+  goto <bb 16>; [100.00%]
 
-  <bb 15> [local count: 113634471]:
+  <bb 17> [local count: 113634470]:
 
-  <bb 6> [local count: 1073741824]:
-  # timeout_13 = PHI <T_timeout_23(D)(15), timeout_39(16)>
+  <bb 8> [local count: 1073741824]:
+  # timeout_13 = PHI <T_timeout_23(D)(17), timeout_39(18)>
   # DEBUG timeout => timeout_13
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _7 = Uart_GetStatus (transChannel_29(D), &T_bytesRemaining, 0);
+  _7 = Uart_GetStatus (transChannel_30(D), &T_bytesRemaining, 0);
   Uart_TransmitStatus ={v} _7;
   # DEBUG BEGIN_STMT
-  _8 = Uart_GetStatus (recvChannel_24(D), &T_bytesRemaining, 1);
+  _8 = Uart_GetStatus (recvChannel_26(D), &T_bytesRemaining, 1);
   Uart_ReceiveStatus ={v} _8;
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.16_9 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.16_9 != 0)
-    goto <bb 7>; [96.34%]
+  Uart_TransmitStatus.20_9 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.20_9 != 0)
+    goto <bb 9>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 7> [local count: 1034442875]:
-  Uart_ReceiveStatus.17_10 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.17_10 != 0)
-    goto <bb 8>; [96.34%]
+  <bb 9> [local count: 1034442875]:
+  Uart_ReceiveStatus.21_10 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.21_10 != 0)
+    goto <bb 10>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 8> [local count: 996582265]:
+  <bb 10> [local count: 996582265]:
   timeout_39 = timeout_13 + 4294967295;
   # DEBUG timeout => timeout_39
   if (timeout_39 != 0)
-    goto <bb 16>; [96.34%]
+    goto <bb 18>; [96.34%]
   else
-    goto <bb 9>; [3.66%]
+    goto <bb 11>; [3.66%]
 
-  <bb 16> [local count: 960107353]:
-  goto <bb 6>; [100.00%]
+  <bb 18> [local count: 960107353]:
+  goto <bb 8>; [100.00%]
 
-  <bb 9> [local count: 113634471]:
+  <bb 11> [local count: 113634471]:
   # DEBUG BEGIN_STMT
-  Uart_TransmitStatus.18_11 ={v} Uart_TransmitStatus;
-  if (Uart_TransmitStatus.18_11 != 0)
-    goto <bb 10>; [33.00%]
+  Uart_TransmitStatus.22_11 ={v} Uart_TransmitStatus;
+  if (Uart_TransmitStatus.22_11 != 0)
+    goto <bb 12>; [33.00%]
   else
-    goto <bb 11>; [67.00%]
+    goto <bb 13>; [67.00%]
 
-  <bb 10> [local count: 37499375]:
+  <bb 12> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (transChannel_29(D), 0);
+  Uart_Abort (transChannel_30(D), 0);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 11> [local count: 113634471]:
+  <bb 13> [local count: 113634471]:
   # DEBUG retVal => NULL
   # DEBUG BEGIN_STMT
-  Uart_ReceiveStatus.19_12 ={v} Uart_ReceiveStatus;
-  if (Uart_ReceiveStatus.19_12 != 0)
-    goto <bb 12>; [33.00%]
+  Uart_ReceiveStatus.23_12 ={v} Uart_ReceiveStatus;
+  if (Uart_ReceiveStatus.23_12 != 0)
+    goto <bb 14>; [33.00%]
   else
-    goto <bb 13>; [67.00%]
+    goto <bb 15>; [67.00%]
 
-  <bb 12> [local count: 37499375]:
+  <bb 14> [local count: 37499375]:
   # DEBUG BEGIN_STMT
-  Uart_Abort (recvChannel_24(D), 1);
+  Uart_Abort (recvChannel_26(D), 1);
   # DEBUG BEGIN_STMT
   # DEBUG retVal => 1
 
-  <bb 13> [local count: 113634471]:
-  # retVal_14 = PHI <1(12), 0(11)>
+  <bb 15> [local count: 113634471]:
+  # retVal_14 = PHI <1(14), 0(13)>
   # DEBUG retVal => retVal_14
   # DEBUG BEGIN_STMT
   _42 = (Std_ReturnType) retVal_14;
 
-  <bb 14> [local count: 215864394]:
-  # _15 = PHI <1(3), 1(5), _42(13)>
+  <bb 16> [local count: 381663302]:
+  # _15 = PHI <1(3), 1(5), 1(7), _42(15), 1(2)>
   T_bytesRemaining ={v} {CLOBBER};
   return _15;
 
@@ -545,9 +535,9 @@ UART_Query_Data (uint8 transChannel, uint8 recvChannel, const uint8 * pBuffer, u
 TestDelay (uint32 delay)
 {
   static volatile uint32 DelayTimer = 0;
-  long unsigned int DelayTimer.12_1;
+  long unsigned int DelayTimer.16_1;
   long unsigned int _2;
-  long unsigned int DelayTimer.13_3;
+  long unsigned int DelayTimer.17_3;
 
   <bb 2> [local count: 118111600]:
   # DEBUG BEGIN_STMT
@@ -556,14 +546,14 @@ TestDelay (uint32 delay)
 
   <bb 3> [local count: 955630223]:
   # DEBUG BEGIN_STMT
-  DelayTimer.12_1 ={v} DelayTimer;
-  _2 = DelayTimer.12_1 + 1;
+  DelayTimer.16_1 ={v} DelayTimer;
+  _2 = DelayTimer.16_1 + 1;
   DelayTimer ={v} _2;
 
   <bb 4> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
-  DelayTimer.13_3 ={v} DelayTimer;
-  if (DelayTimer.13_3 < delay_6(D))
+  DelayTimer.17_3 ={v} DelayTimer;
+  if (DelayTimer.17_3 < delay_6(D))
     goto <bb 3>; [89.00%]
   else
     goto <bb 5>; [11.00%]
@@ -576,6 +566,101 @@ TestDelay (uint32 delay)
 }
 
 
+CanIf_SendMessage (uint8 ControllerId, struct Can_Msg_Type CanMsg)
+{
+  Can_HwHandleType Hth;
+  uint8 u8TimeOut;
+  Std_ReturnType retVal;
+  volatile Std_ReturnType CAN_Write_Status;
+  volatile struct Can_PduType Can_PduInfo;
+  short unsigned int _1;
+  long unsigned int _2;
+  <unnamed type> _3;
+  unsigned char _4;
+  uint8 * _5;
+  unsigned char _6;
+  unsigned char CAN_Write_Status.12_7;
+  _Bool CanIf_bTxFlag.14_8;
+  _Bool CanIf_bTxFlag.15_9;
+
+  <bb 2> [local count: 138405320]:
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+  # DEBUG BEGIN_STMT
+  # DEBUG u8TimeOut => 100
+  # DEBUG BEGIN_STMT
+  _1 = (short unsigned int) ControllerId_14(D);
+  Hth_15 = _1 + 1;
+  # DEBUG Hth => Hth_15
+  # DEBUG BEGIN_STMT
+  _2 = CanMsg.id;
+  _3 = CanMsg.idFrame;
+  _4 = CanMsg.length;
+  _5 = CanMsg.sdu;
+  Can_PduInfo ={v} Can_CreatePduInfo (_2, _3, 0, _4, _5);
+  # DEBUG BEGIN_STMT
+  _6 = Can_Write (Hth_15, &Can_PduInfo);
+  CAN_Write_Status ={v} _6;
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag = 0;
+  # DEBUG BEGIN_STMT
+  CAN_Write_Status.12_7 ={v} CAN_Write_Status;
+  if (CAN_Write_Status.12_7 == 0)
+    goto <bb 9>; [50.00%]
+  else
+    goto <bb 6>; [50.00%]
+
+  <bb 9> [local count: 69202660]:
+  goto <bb 4>; [100.00%]
+
+  <bb 3> [local count: 1004539164]:
+  # DEBUG BEGIN_STMT
+  Can_MainFunction_Write ();
+  # DEBUG BEGIN_STMT
+  Can_DummyDelay (100);
+  # DEBUG BEGIN_STMT
+  u8TimeOut_23 = u8TimeOut_11 + 255;
+  # DEBUG u8TimeOut => u8TimeOut_23
+
+  <bb 4> [local count: 1073741824]:
+  # u8TimeOut_11 = PHI <u8TimeOut_23(3), 100(9)>
+  # DEBUG u8TimeOut => u8TimeOut_11
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.14_8 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.14_8 != 0)
+    goto <bb 6>; [5.50%]
+  else
+    goto <bb 5>; [94.50%]
+
+  <bb 5> [local count: 1014686024]:
+  if (u8TimeOut_11 != 0)
+    goto <bb 3>; [99.00%]
+  else
+    goto <bb 6>; [1.00%]
+
+  <bb 6> [local count: 138405321]:
+  # DEBUG BEGIN_STMT
+  CanIf_bTxFlag.15_9 = CanIf_bTxFlag;
+  if (CanIf_bTxFlag.15_9 != 0)
+    goto <bb 8>; [50.00%]
+  else
+    goto <bb 7>; [50.00%]
+
+  <bb 7> [local count: 69202660]:
+  # DEBUG BEGIN_STMT
+  # DEBUG retVal => 1
+
+  <bb 8> [local count: 138405321]:
+  # retVal_10 = PHI <0(6), 1(7)>
+  # DEBUG retVal => retVal_10
+  # DEBUG BEGIN_STMT
+  return retVal_10;
+
+}
+
+
 Can_DummyDelay (uint32 loops)
 {
   volatile uint32 contor2;
@@ -674,7 +759,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   uint8 * _4;
   unsigned char CanIf_u8RxIndicationCnt.2_5;
   int _6;
-  struct Can_MsgType * _7;
+  struct Can_Msg_Type * _7;
   unsigned char _8;
   long unsigned int _14;
   long unsigned int _15;
@@ -683,8 +768,6 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG BEGIN_STMT
   CanIf_bRxFlag = 1;
   # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
-  # DEBUG BEGIN_STMT
   _1 = Mailbox_11(D)->CanId;
   _2 = PduInfoPtr_12(D)->SduLength;
   _3 = (unsigned char) _2;
@@ -697,7 +780,7 @@ CanIf_RxIndication (const struct Can_HwType * Mailbox, const struct PduInfoType
   # DEBUG INLINE_ENTRY Can_GetMsgInfo
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _14 = _1 & 2147483647;
+  _14 = _1 & 1073741823;
   # DEBUG CanMsgInfo$id => _14
   # DEBUG BEGIN_STMT
   _15 = _1 >> 30;
@@ -776,7 +859,7 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
   <bb 2> [local count: 1073741824]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  _1 = id_3(D) & 2147483647;
+  _1 = id_3(D) & 1073741823;
   # DEBUG CanMsgInfo$id => _1
   # DEBUG BEGIN_STMT
   _2 = id_3(D) >> 30;
@@ -805,51 +888,69 @@ Can_GetMsgInfo (Can_IdType id, uint8 length, uint8 * sdu)
 
 Can_CreatePduInfo (Can_IdType id, CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8 * sdu)
 {
-  <bb 2> [local count: 1073741824]:
+  long unsigned int _1;
+
+  <bb 2> [local count: 1073741823]:
   # DEBUG BEGIN_STMT
   # DEBUG BEGIN_STMT
-  switch (idFrame_2(D)) <default: <L8> [25.00%], case 1: <L1> [25.00%], case 2: <L2> [25.00%], case 3: <L3> [25.00%]>
+  switch (idFrame_3(D)) <default: <L4> [20.00%], case 0: <L0> [20.00%], case 1: <L1> [20.00%], case 2: <L2> [20.00%], case 3: <L3> [20.00%]>
 
-  <bb 3> [local count: 268435456]:
+  <bb 3> [local count: 214748364]:
+<L0>:
+  # DEBUG BEGIN_STMT
+  id_8 = id_4(D) & 2047;
+  # DEBUG id => id_8
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 4> [local count: 214748364]:
 <L1>:
   # DEBUG BEGIN_STMT
-  id_5 = id_3(D) | 1073741824;
-  # DEBUG id => id_5
+  _1 = id_4(D) & 2047;
+  id_7 = _1 | 1073741824;
+  # DEBUG id => id_7
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 4> [local count: 268435456]:
+  <bb 5> [local count: 214748364]:
 <L2>:
   # DEBUG BEGIN_STMT
-  id_4 = id_3(D) | 2147483648;
-  # DEBUG id => id_4
+  id_6 = id_4(D) | 2147483648;
+  # DEBUG id => id_6
   # DEBUG BEGIN_STMT
-  goto <bb 6>; [100.00%]
+  goto <bb 8>; [100.00%]
 
-  <bb 5> [local count: 268435456]:
+  <bb 6> [local count: 214748364]:
 <L3>:
   # DEBUG BEGIN_STMT
-  id_6 = id_3(D) | 3221225472;
-  # DEBUG id => id_6
+  id_5 = id_4(D) | 3221225472;
+  # DEBUG id => id_5
+  # DEBUG BEGIN_STMT
+  goto <bb 8>; [100.00%]
+
+  <bb 7> [local count: 214748364]:
+<L4>:
+  # DEBUG BEGIN_STMT
+  id_9 = id_4(D) & 2047;
+  # DEBUG id => id_9
   # DEBUG BEGIN_STMT
 
-  <bb 6> [local count: 1073741824]:
-  # id_1 = PHI <id_3(D)(2), id_5(3), id_4(4), id_6(5)>
-<L8>:
-  # DEBUG id => id_1
+  <bb 8> [local count: 1073741824]:
+  # id_2 = PHI <id_8(3), id_7(4), id_6(5), id_5(6), id_9(7)>
+  # DEBUG id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$id => id_1
+  # DEBUG PduInfo$id => id_2
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$swPduHandle => swPduHandle_8(D)
+  # DEBUG PduInfo$swPduHandle => swPduHandle_11(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$length => length_9(D)
+  # DEBUG PduInfo$length => length_12(D)
   # DEBUG BEGIN_STMT
-  # DEBUG PduInfo$sdu => sdu_10(D)
+  # DEBUG PduInfo$sdu => sdu_13(D)
   # DEBUG BEGIN_STMT
-  MEM[(struct  *)&<retval>] = id_1;
-  MEM[(struct  *)&<retval> + 4B] = swPduHandle_8(D);
-  MEM[(struct  *)&<retval> + 6B] = length_9(D);
-  MEM[(struct  *)&<retval> + 8B] = sdu_10(D);
+  MEM[(struct  *)&<retval>] = id_2;
+  MEM[(struct  *)&<retval> + 4B] = swPduHandle_11(D);
+  MEM[(struct  *)&<retval> + 6B] = length_12(D);
+  MEM[(struct  *)&<retval> + 8B] = sdu_13(D);
   # DEBUG D#1 => {CLOBBER}
   # DEBUG PduInfo$id => D#1
   # DEBUG D#2 => {CLOBBER}

BIN
Debug_FLASH/src/main.o


+ 15 - 14
Debug_FLASH/src/main.su

@@ -1,14 +1,15 @@
-main.c:222:0:Can_CreatePduInfo	0	static
-main.c:250:0:Can_GetMsgInfo	12	static
-main.c:262:0:CanIf_ControllerBusOff	0	static
-main.c:267:0:CanIf_ControllerModeIndication	0	static
-main.c:272:0:CanIf_TxConfirmation	0	static
-main.c:279:0:CanIf_RxIndication	20	static
-main.c:289:0:CanIf_CurrentIcomConfiguration	0	static
-main.c:296:0:Can_DummyDelay	32	static
-main.c:318:0:TestDelay	0	static
-main.c:344:0:UART_Query_Data	48	static
-main.c:409:0:UART_Send_Data	40	static
-main.c:447:0:UART_Receive_Data	40	static
-main.c:491:0:UART_Callback	4	static
-main.c:530:0:main	24	static
+main.c:174:0:Can_CreatePduInfo	0	static
+main.c:204:0:Can_GetMsgInfo	12	static
+main.c:216:0:CanIf_ControllerBusOff	0	static
+main.c:221:0:CanIf_ControllerModeIndication	0	static
+main.c:226:0:CanIf_TxConfirmation	0	static
+main.c:233:0:CanIf_RxIndication	20	static
+main.c:245:0:CanIf_CurrentIcomConfiguration	0	static
+main.c:252:0:Can_DummyDelay	32	static
+main.c:270:0:CanIf_SendMessage	56	static
+main.c:307:0:TestDelay	0	static
+main.c:333:0:UART_Query_Data	48	static
+main.c:401:0:UART_Send_Data	40	static
+main.c:443:0:UART_Receive_Data	40	static
+main.c:490:0:UART_Callback	4	static
+main.c:526:0:main	32	static

+ 94 - 82
src/main.c

@@ -132,55 +132,7 @@ boolean CanIf_bTxFlag = FALSE;
 uint8 CanIf_u8RxIndicationCnt = 0U;
 boolean CanIf_bRxFlag = FALSE;
 
-#if 1
-static const Flexcan_Ip_DataInfoType CAN_TJA1153_MB_Config_1 = {
-		.data_length = 0u,
-		.msg_id_type = FLEXCAN_MSG_ID_STD,
-		.is_polling  = true
-};
-
-/* Configure TJA1153 sproofing protection, 0x10 command byte */
-static const Flexcan_Ip_DataInfoType TJA1153_SpoofingProtect_Config_Form = {
-		.data_length = 6u,
-		.msg_id_type = FLEXCAN_MSG_ID_EXT,
-		.is_polling  = true
-};
-
-/* Configure TJA1153 flooding and tamper protection, 0x40 command byte */
-static const Flexcan_Ip_DataInfoType TJA1153_FloodTamperProt_Config_Form = {
-		.data_length = 2u,
-		.msg_id_type = FLEXCAN_MSG_ID_STD,
-		.is_polling  = true
-};
-
-/* Configure bit time, secure mode timeout, blacklist, etc. 0x50 command byte */
-static const Flexcan_Ip_DataInfoType TJA1153_BitTimeLength_Config_Form = {
-		.data_length = 3u,
-		.msg_id_type = FLEXCAN_MSG_ID_STD,
-		.is_polling  = true
-};
-
-/* Configure TJA1153 command message id, 0x60 command byte */
-static const Flexcan_Ip_DataInfoType TJA1153_CommandMessageID_Config_Form = {
-		.data_length = 5u,
-		.msg_id_type = FLEXCAN_MSG_ID_STD,
-		.is_polling  = true
-};
-
-/* Configure TJA1153 leaving configuration mode message format, 0x71, 0x72, 0x74 command byte */
-static const Flexcan_Ip_DataInfoType TJA1153_LeaveConfigMode_Config_Form = {
-		.data_length = 8u,
-		.msg_id_type = FLEXCAN_MSG_ID_STD,
-		.is_polling  = true
-};
-
-/* Configure TJA1153 verification of configure message, 0xF0 command byte */
-static const Flexcan_Ip_DataInfoType TJA1153_ConfigVerify_Config_Form = {
-		.data_length = 3u,
-		.msg_id_type = FLEXCAN_MSG_ID_STD,
-		.is_polling  = true
-};
-#endif
+
 /*==================================================================================================
 *                                   LOCAL FUNCTION PROTOTYPES
 ==================================================================================================*/
@@ -214,10 +166,10 @@ typedef struct
     uint8 * sdu; /**< @brief CAN L-SDU = Link Layer Service Data
                                                           Unit. Data that is transported inside
                                                           the L-PDU. */
-} Can_MsgType;
+} Can_Msg_Type;
 
 
-Can_MsgType canRxMsg_Buff[100];
+Can_Msg_Type canRxMsg_Buff[100];
 
 Can_PduType Can_CreatePduInfo(Can_IdType id,CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8* sdu)
 {
@@ -225,9 +177,10 @@ Can_PduType Can_CreatePduInfo(Can_IdType id,CAN_IdFrameType idFrame, PduIdType s
     switch(idFrame)
     {
     case CAN_STANDARD_ID_TYPE:
+    	id = id & 0x7FF;
     	break;
     case CANFD_STANDARD_ID_TYPE:
-    	id = id | 0x40000000;
+    	id = (id & 0x7FF) | 0x40000000;
     	break;
     case CAN_EXTENDED_ID_TYPE:
     	id = id | 0x80000000;
@@ -236,6 +189,7 @@ Can_PduType Can_CreatePduInfo(Can_IdType id,CAN_IdFrameType idFrame, PduIdType s
     	id = id | 0xC0000000;
     	break;
     default:
+    	id = id & 0x7FF;
     	break;
 
     }
@@ -247,12 +201,20 @@ Can_PduType Can_CreatePduInfo(Can_IdType id,CAN_IdFrameType idFrame, PduIdType s
     return PduInfo;
 }
 
-Can_MsgType Can_GetMsgInfo(Can_IdType id, uint8 length, uint8* sdu)
+Can_Msg_Type Can_GetMsgInfo(Can_IdType id, uint8 length, uint8* sdu)
 {
-	Can_MsgType CanMsgInfo;
+	Can_Msg_Type CanMsgInfo;
+
 
-	CanMsgInfo.id = id&0x7FFFFFFF;
 	CanMsgInfo.idFrame = (CAN_IdFrameType)((id>>30) &0x03);
+	if(CanMsgInfo.idFrame&0x01)
+	{
+		CanMsgInfo.id = id&0x7FF;
+	}
+	else
+	{
+		CanMsgInfo.id = id&0x1FFFFFFF;
+	}
 	CanMsgInfo.length = length;
 	CanMsgInfo.sdu = sdu;
 
@@ -279,9 +241,11 @@ void CanIf_TxConfirmation(PduIdType CanTxPduId)
 void CanIf_RxIndication(const Can_HwType* Mailbox, const PduInfoType* PduInfoPtr )
 {
 
-    CanIf_bRxFlag = TRUE;
-    (void)Mailbox;
-    (void)PduInfoPtr;
+    CanIf_bRxFlag = TRUE;  //should not be delete
+//    (void)Mailbox;
+//    (void)PduInfoPtr;
+
+    // should put the msg into message quene
     canRxMsg_Buff[CanIf_u8RxIndicationCnt] = Can_GetMsgInfo(Mailbox->CanId,PduInfoPtr->SduLength,PduInfoPtr->SduDataPtr);
     CanIf_u8RxIndicationCnt++;
 }
@@ -311,6 +275,39 @@ void Can_DummyDelay(uint32 loops)
 
 
 
+Std_ReturnType CanIf_SendMessage(uint8 ControllerId, Can_Msg_Type CanMsg)
+{
+	volatile Can_PduType Can_PduInfo;
+	volatile Std_ReturnType CAN_Write_Status;
+	Std_ReturnType retVal = E_NOT_OK;
+	uint8 u8TimeOut = 100U;
+	Can_HwHandleType Hth = Can0HardwareObject_TX + (Can_HwHandleType)ControllerId;  //controller 0 --> Can0HardwareObject_TX
+
+	Can_PduInfo = Can_CreatePduInfo(CanMsg.id,CanMsg.idFrame, 0, CanMsg.length, CanMsg.sdu);
+
+	CAN_Write_Status = Can_Write(Hth, &Can_PduInfo);
+
+	CanIf_bTxFlag = FALSE;
+	if(CAN_Write_Status == E_OK)
+	{
+		while((!CanIf_bTxFlag) && (u8TimeOut != 0U))
+		{
+			Can_MainFunction_Write();
+			Can_DummyDelay(100U);
+			u8TimeOut--;
+		}
+	}
+
+	if(CanIf_bTxFlag == TRUE)
+	{
+		retVal = E_OK;
+	}
+	else
+	{
+		retVal = E_NOT_OK;
+	}
+	return retVal;
+}
 
 #endif
 
@@ -325,12 +322,12 @@ void TestDelay(uint32 delay)
     DelayTimer=0;
 }
 
-//boolean User_Str_Cmp(const uint8 * pBuffer1, const uint8 * pBuffer2, const uint32 length)
+//boolean User_Str_Cmp(const uint8 * txBuffer1, const uint8 * txBuffer2, const uint32 length)
 //{
 //    uint32 idx = 0;
 //    for (idx = 0; idx < length; idx++)
 //    {
-//        if(pBuffer1[idx] != pBuffer2[idx])
+//        if(txBuffer1[idx] != txBuffer2[idx])
 //        {
 //            return FALSE;
 //        }
@@ -341,7 +338,7 @@ void TestDelay(uint32 delay)
 
 
 
-Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint8* pBuffer,  uint32 sendLength, uint8* RxBuffer, uint32 T_timeout)
+Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint8* txBuffer,  uint32 sendLength, uint8* rxBuffer, uint32 T_timeout)
 {
     volatile Std_ReturnType R_Uart_Status;
     volatile Std_ReturnType T_Uart_Status;
@@ -355,9 +352,13 @@ Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint
 
     /* Uart_AsyncReceive transmit data */
 //    IP_LPUART0->CTRL |= LPUART_CTRL_ILIE(0);
+    if(txBuffer == NULL || rxBuffer == NULL)
+    {
+    	return retVal;
+    }
 
    	Uart_SetBuffer(recvChannel,&RX_Buffer[recvChannel][0],DMA_SIZE,UART_RECEIVE);
-   	R_Uart_Status = Uart_AsyncReceive(recvChannel, RxBuffer, DMA_SIZE);
+   	R_Uart_Status = Uart_AsyncReceive(recvChannel, rxBuffer, DMA_SIZE);
    	if (E_OK != T_Uart_Status)
    	{
    		Uart_Abort(recvChannel,UART_RECEIVE);
@@ -366,8 +367,8 @@ Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint
 
 
     /* Uart_AsyncSend transmit data */
-    Uart_SetBuffer(transChannel,pBuffer,sendLength,UART_SEND);
-    T_Uart_Status = Uart_AsyncSend(transChannel, pBuffer, sendLength);
+    Uart_SetBuffer(transChannel,txBuffer,sendLength,UART_SEND);
+    T_Uart_Status = Uart_AsyncSend(transChannel, txBuffer, sendLength);
     if (E_OK != T_Uart_Status)
     {
     	Uart_Abort(transChannel,UART_SEND);
@@ -385,7 +386,6 @@ Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint
     if ((UART_STATUS_NO_ERROR != Uart_TransmitStatus))
 	{
     	Uart_Abort(transChannel,UART_SEND);
-//    	IP_LPUART0->CTRL |= LPUART_CTRL_ILIE(1);
     	retVal = E_NOT_OK;
 	}
     else
@@ -406,7 +406,7 @@ Std_ReturnType UART_Query_Data(uint8 transChannel, uint8 recvChannel, const uint
     return retVal;
 }
 
-Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8* pBuffer,  uint32 sendLength, uint32 T_timeout)
+Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8* txBuffer,  uint32 sendLength, uint32 T_timeout)
 {
 
     volatile Std_ReturnType T_Uart_Status;
@@ -416,10 +416,14 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8* pBuffer,  uint32
     uint32 retVal = E_NOT_OK;
 //    uint8 Rx_Buffer[MSG_LEN];
 
+    if(txBuffer == NULL)
+    {
+    	return retVal;
+    }
 
     /* Uart_AsyncSend transmit data */
-    Uart_SetBuffer(transChannel,pBuffer,sendLength,UART_SEND);
-    T_Uart_Status = Uart_AsyncSend(transChannel, pBuffer, sendLength);
+    Uart_SetBuffer(transChannel,txBuffer,sendLength,UART_SEND);
+    T_Uart_Status = Uart_AsyncSend(transChannel, txBuffer, sendLength);
     if (E_OK != T_Uart_Status)
     {
     	Uart_Abort(transChannel,UART_SEND);
@@ -444,7 +448,7 @@ Std_ReturnType UART_Send_Data(uint8 transChannel, const uint8* pBuffer,  uint32
     return retVal;
 }
 
-uint32 UART_Receive_Data(uint8 recvChannel, uint8* RxBuffer, uint32 T_timeout)
+uint32 UART_Receive_Data(uint8 recvChannel, uint8* rxBuffer, uint32 T_timeout)
 {
     volatile Std_ReturnType R_Uart_Status;
     volatile Uart_StatusType Uart_ReceiveStatus = UART_STATUS_TIMEOUT;
@@ -453,10 +457,13 @@ uint32 UART_Receive_Data(uint8 recvChannel, uint8* RxBuffer, uint32 T_timeout)
     uint32 retVal = E_NOT_OK;
 //    uint8 Rx_Buffer[MSG_LEN];
 
-
+    if(rxBuffer == NULL)
+    {
+    	return retVal;
+    }
     /* Uart_AsyncReceive transmit data */
    	Uart_SetBuffer(recvChannel,&RX_Buffer[recvChannel][0],DMA_SIZE,UART_RECEIVE);
-   	R_Uart_Status = Uart_AsyncReceive(recvChannel, RxBuffer, DMA_SIZE);
+   	R_Uart_Status = Uart_AsyncReceive(recvChannel, rxBuffer, DMA_SIZE);
    	if (E_OK != R_Uart_Status)
    	{
    		Uart_Abort(recvChannel,UART_RECEIVE);
@@ -491,9 +498,7 @@ uint32_t bufferIdx;
 void UART_Callback(uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void *userData)
 {
 
-#if 1
-    /* Unused parameters */
-//    (void)driverState;
+
     (void)userData;
     uint32_t temp;
 
@@ -519,7 +524,6 @@ void UART_Callback(uint32 hwInstance, Lpuart_Uart_Ip_EventType event, void *user
         /*Abort the receiving after detecting IDLE receiving*/
     	Lpuart_Uart_Ip_AbortReceivingData(hwInstance);
     }
-#endif
 }
 /*!
   \brief The main function for the project.
@@ -535,8 +539,8 @@ int main(void)
 	volatile Std_ReturnType T_Uart_Status3;
 	volatile Std_ReturnType R_Uart_Status1;
 	volatile Std_ReturnType R_Uart_Status2;
-	static Can_PduType Can_PduInfo;
-	static Can_PduType Can_PduInfo1;
+	static Can_Msg_Type Can_MsgInfo;
+//	static Can_PduType Can_PduInfo1;
 	volatile Std_ReturnType CAN_Write_Status;
 	uint8 rxBuffer[100];
 
@@ -608,7 +612,7 @@ int main(void)
 #elif(CAN_PRECOMPILE_SUPPORT == STD_OFF)
 	Can_Init(&Can_Config_VS_0);
 #endif
-
+	Can_SetControllerMode(CanController_0, CAN_CS_STARTED);
 
 #endif
 #if 0
@@ -639,12 +643,17 @@ int main(void)
 	//T_Uart_Status2 = Send_Data(UART_LPUART0_INTERNAL_CHANNEL, (const uint8 *)WELCOME_MSG_2, strlen(WELCOME_MSG_2));
 
 	/* Can_CreatePduInfo(id, swPduHandle,length, sdu) */
-	Can_PduInfo = Can_CreatePduInfo(0x55U, CAN_EXTENDED_ID_TYPE, 0U, 8U, Can_au8Sdu8bytes);
+//	Can_PduInfo = Can_CreatePduInfo(0x55U, CAN_EXTENDED_ID_TYPE, 0U, 8U, Can_au8Sdu8bytes);
 //	Can_PduInfo1 = Can_CreatePduInfo(0x66U, 0U, 2U, Can_au8Sdu8bytes);
+	Can_MsgInfo.id = 0x18123456;
+	Can_MsgInfo.idFrame = CAN_EXTENDED_ID_TYPE;
+	Can_MsgInfo.length = 8;
+	Can_MsgInfo.sdu = Can_au8Sdu8bytes;
+
 	  /* Initilize Can driver */
 
 	//Can_Init(&Can_Config_VS_0);
-	Can_SetControllerMode(CanController_0, CAN_CS_STARTED);
+
 //	Can_SetControllerMode(CanController_1, CAN_CS_STARTED);
 //	Dio_WriteChannel(DioConf_DioChannel_PTE4_GPIO_OUT_MCU_4G_POW_EN,STD_ON);  //ʹÄÜpower
 //	Dio_WriteChannel(DioConf_DioChannel_PTB20_GPIO_OUT_MCU_4G_PWRKEY,STD_ON); //ÕýÏòÂö³åʹÆ俪»ú
@@ -672,12 +681,15 @@ int main(void)
 //		  Dio_WriteChannel(DioConf_DioChannel_DioChannel_LED0,pinValue);
 //		  Dio_WriteChannel(DioConf_DioChannel_DioChannel_LED1,pinValue);
 
-		  CAN_Write_Status = Can_Write(Can0HardwareObject_TX, &Can_PduInfo);
+//		  CAN_Write_Status = Can_Write(Can0HardwareObject_TX, &Can_PduInfo);
+		  //Std_ReturnType CanIf_SendMessage(uint8 ControllerId, Can_IdType id,CAN_IdFrameType idFrame, PduIdType swPduHandle, uint8 length, uint8* sdu)
+		  CanIf_SendMessage(0,Can_MsgInfo);
+
 //		  if(CAN_Write_Status == E_OK)
 //		  {
 //			  while((!CanIf_bTxFlag) && (u8TimeOut != 0U))
 //			  {
-					Can_MainFunction_Write();
+//					Can_MainFunction_Write();
 //					Can_DummyDelay(100U);
 //					u8TimeOut--;
 //			  }

Vissa filer visades inte eftersom för många filer har ändrats