-
-/** @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 */
-}