]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
Get rid of sciNotification() and sciLowLevelInterrupt()
authorMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 24 Jul 2014 11:39:56 +0000 (13:39 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 24 Jul 2014 11:39:56 +0000 (13:39 +0200)
sciNotification (probably generated by HalCoGen) didn't serve any
reasonable purpose. We replaced its only meaningful occurrence in receive
interrupt by the actual work done there - clearing error flags. This
clearing was hidden in sciReceive(). Now things are much more
straightforward.

sciLowLevelInterrupt was not used at all.

rpp/src/sys/notification.c
rpp/src/sys/ti_drv_sci.c

index 497bc4789bf0b9c0474a355033165482a75e4154..0bd6fa767589bd2960ebde69ed45937c4d52b6cd 100644 (file)
@@ -193,18 +193,6 @@ void mibspiGroupNotification(mibspiBASE_t *mibspi, uint32_t group)
 /* USER CODE BEGIN (28) */
 /* USER CODE END */
 
-void sciNotification(sciBASE_t *sci, uint32_t flags)
-{
-/* USER CODE BEGIN (29) */
-    if (sci == sciREG) {
-        if (flags & SCI_RX_INT) {
-            sciReceive(sci, 1, NULL);   // Restart receiving
-        }
-    }
-/* USER CODE END */
-
-}
-
 /* USER CODE BEGIN (30) */
 /* USER CODE END */
 void pwmNotification(hetBASE_t * hetREG,uint32_t pwm, uint32_t notification)
index ef8b6b965e88f3656b49c81db76a75429877ca1b..29985201c69d0f4e6c846e1c7e4db9293181fa72 100644 (file)
@@ -474,19 +474,19 @@ void sciHighLevelInterrupt(void)
     switch (vec)
     {
     case 1:
-        sciNotification(sciREG, SCI_WAKE_INT);
+        //sciNotification(sciREG, SCI_WAKE_INT);
         break;
     case 3:
-        sciNotification(sciREG, SCI_PE_INT);
+        //sciNotification(sciREG, SCI_PE_INT);
         break;
     case 6:
-        sciNotification(sciREG, SCI_FE_INT);
+        //sciNotification(sciREG, SCI_FE_INT);
         break;
     case 7:
-        sciNotification(sciREG, SCI_BREAK_INT);
+        //sciNotification(sciREG, SCI_BREAK_INT);
         break;
     case 9:
-        sciNotification(sciREG, SCI_OE_INT);
+        //sciNotification(sciREG, SCI_OE_INT);
         break;
 
     case 11:
@@ -495,7 +495,8 @@ void sciHighLevelInterrupt(void)
             if (xQueueSendFromISR(sciInBuffer.buf, (void*)&byte, NULL) == errQUEUE_FULL) {
                 receiveError++;
             }
-            sciNotification(sciREG, SCI_RX_INT);
+            /* clear error flags */
+            sciREG->FLR = SCI_FE_INT | SCI_OE_INT | SCI_PE_INT;
         }
         break;
 
@@ -521,71 +522,3 @@ void sciHighLevelInterrupt(void)
 /* USER CODE BEGIN (27) */
 /* USER CODE END */
 }
-
-/** @fn void sciLowLevelInterrupt(void)
-*   @brief Level 1 Interrupt for SCI
-*/
-#pragma INTERRUPT(sciLowLevelInterrupt, IRQ)
-
-void sciLowLevelInterrupt(void)
-{
-    uint32_t vec = sciREG->INTVECT1;
-
-/* USER CODE BEGIN (28) */
-/* USER CODE END */
-
-    switch (vec)
-    {
-    case 1:
-        sciNotification(sciREG, SCI_WAKE_INT);
-        break;
-    case 3:
-        sciNotification(sciREG, SCI_PE_INT);
-        break;
-    case 6:
-        sciNotification(sciREG, SCI_FE_INT);
-        break;
-    case 7:
-        sciNotification(sciREG, SCI_BREAK_INT);
-        break;
-    case 9:
-        sciNotification(sciREG, SCI_OE_INT);
-        break;
-
-    case 11:
-        /* receive */
-        {   uint32_t byte = sciREG->RD;
-
-            if (g_sciTransfer[0].length > 0)
-            {
-                *g_sciTransfer[0].data++ = byte;
-                g_sciTransfer[0].length--;
-                if (g_sciTransfer[0].length == 0)
-                {
-                    sciNotification(sciREG, SCI_RX_INT);
-                }
-            }
-        }
-        break;
-
-    case 12:
-        /* transmit */
-        if (--g_sciTransfer[0].length > 0)
-        {
-            sciREG->TD = *g_sciTransfer[0].data++;
-        }
-        else
-        {
-            sciREG->CLRINT = SCI_TX_INT;
-            sciNotification(sciREG, SCI_TX_INT);
-        }
-        break;
-
-    default:
-        /* phantom interrupt, clear flags and return */
-        sciREG->FLR = sciREG->SETINTLVL & 0x07000303;
-         break;
-    }
-/* USER CODE BEGIN (29) */
-/* USER CODE END */
-}