paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [5856] notified the status of the transaction to Fai


From: antoine drouin
Subject: [paparazzi-commits] [5856] notified the status of the transaction to Failed if the queue is full when submitting
Date: Tue, 14 Sep 2010 14:26:50 +0000

Revision: 5856
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5856
Author:   poine
Date:     2010-09-14 14:26:49 +0000 (Tue, 14 Sep 2010)
Log Message:
-----------
notified the status of the transaction to Failed if the queue is full when 
submitting

Modified Paths:
--------------
    paparazzi3/trunk/sw/airborne/arm7/i2c_hw.c

Modified: paparazzi3/trunk/sw/airborne/arm7/i2c_hw.c
===================================================================
--- paparazzi3/trunk/sw/airborne/arm7/i2c_hw.c  2010-09-13 22:49:51 UTC (rev 
5855)
+++ paparazzi3/trunk/sw/airborne/arm7/i2c_hw.c  2010-09-14 14:26:49 UTC (rev 
5856)
@@ -323,21 +323,21 @@
   uint8_t idx;
   idx = p->trans_insert_idx + 1;
   if (idx >= I2C_TRANSACTION_QUEUE_LEN) idx = 0;
-  if (idx == p->trans_extract_idx)
-    return FALSE;                          // queue full
-
+  if (idx == p->trans_extract_idx) {
+    t->status = I2CTransFailed;
+    return FALSE;  /* queue full */
+  }
   t->status = I2CTransPending;
-
-  // disable irq
   int_disable();
   p->trans[p->trans_insert_idx] = t;
   p->trans_insert_idx = idx;
   /* if peripheral is idle, start the transaction */
   if (p->status == I2CIdle)
     I2cSendStart(p);
-  /* else it will be started by the interrupt handler when the previous 
transactions completes */
-  // enable irq
+  /* else it will be started by the interrupt handler */
+  /* when the previous transactions completes         */
   int_enable();
+
   return TRUE;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]