]> rtime.felk.cvut.cz Git - arc.git/blobdiff - arch/arm/arm_cr4/drivers/Can.c
Added example of CAN communication for the TMS570LS31x HDK
[arc.git] / arch / arm / arm_cr4 / drivers / Can.c
index d1ecd33330643560b5893869db4a2cbc06314223..3f17ac90be9aefc49e5a4a7490308361774704d3 100644 (file)
@@ -41,6 +41,8 @@
 #define Dem_ReportErrorStatus(...)\r
 #endif\r
 \r
+static sint8 IfRegId = 0;\r
+\r
 /* Macro for waiting until busy flag is 0 */\r
 #define DCAN_WAIT_UNTIL_NOT_BUSY(ControllerId, IfRegId) \\r
     { \\r
@@ -104,7 +106,6 @@ static Can_StateType            ModuleState = CAN_UNINIT;
 static CanIf_ControllerModeType ControllerMode[CAN_ARC_CTRL_CONFIG_CNT];\r
 \r
 /* Used to switch between IF1 and IF2 of DCAN */\r
-static uint8 IfRegId = 0;\r
 \r
 /* Used to order Data Bytes according to hardware registers in DCAN */\r
 static const uint8 ElementIndex[] = {3, 2, 1, 0, 7, 6, 5, 4};\r
@@ -885,10 +886,10 @@ Can_ReturnType Can_Write(Can_Arc_HTHType Hth, Can_PduType *PduInfo)
                                                                                        | (0x000F & PduInfo->length) // Set DLC\r
                                                                                        | (CanControllerConfigData[ControllerId].CanTxProcessing << 1); // Tx confirmation interrupt enabled\r
 \r
-\r
     /* Set ArbitrationRegister */\r
     CanRegs[ControllerId]->IFx[IfRegId].ARB = ArbRegValue;\r
 \r
+\r
     /* Set Databytes */\r
     for(DataByteIndex = 0; DataByteIndex < PduInfo->length; DataByteIndex++)\r
     {\r